 Baiklah, mari kita mulakan. Selamat datang kembali ke episod lagi Singapore PHB Podcast, dan kita sekarang di episode 4, saya rasa. Ya, jadi hari ini kita ada... Dengan kita pada podcast kita, kita ada Huy Ren. Dan sejujurnya, ini Lion. Jadi kita semua akan bercakap tentang PHB. Apa dengan P.H.P. semua? Jadi, apa dengan Huy Ren dan Huy Ren? Ada sesuatu yang hebat untuk berkongsi dengan kita? Ya, jadi kita boleh bercakap sedikit tentang kelebihan kita, seperti RFC dan sebagainya yang berlaku di di P.H.P. Seperti yang anda tahu, kita sudah ada setaulah kelebihan yang digunakan untuk P.H.P. 8.0. Dan... kelebihan ini akan berlaku... juga akan berlaku kelebihan yang telah dilaporkan dalam RFC. Dan mereka mungkin akan ke 8.1 atau kelebihan kecil 8.0. Jadi kita akan melihat bagaimana ia berlaku dulu. Sebelum itu, kita boleh bercakap tentang siapa akan berlaku kelebihan kelebihan kita. Baiklah. Jadi mari kita tengok kelebihan kita di sini. Seperti yang anda lihat, ada dua kelebihan. Jadi kelebihan pertama adalah pada 21 April, yang sebenarnya sudah sekejap. Sebelum kita bercakap dengan lebih jauh, mungkin kita boleh bercakap tentang proses kelebihan kelebihan di P.H.P. Kita ingin beritahu. Saya rasa mungkin kita hanya bercakap tentang kenapa... tentang siapa yang... apa adalah kelebihan kelebihan kelebihan? Dan mungkin... bagaimana kelebihan dapat digunakan kelebihan kelebihan? Jadi kelebihan kelebihan kelebihan. Satu dari orang yang penting, ada... sebenarnya, saya rasa ada... ada... satu orang penting yang adalah kelebihan kelebihan. Mereka akan... nama mereka akan diberitahu. Mereka akan selalu diberitahu kelebihan baru. Jadi apabila anda melihat e-mel yang datang dari kelebihan kelebihan kelebihan, ia akan... ia akan ada... nama di bawah sana. Okey, itu adalah salah satu... salah satu penting yang penting. Kemudian daripada itu, saya rasa mereka juga diberitahu dengan... apa yang... seperti... mereka mengambil kelebihan kelebihan kelebihan kelebihan juga. Jadi seperti... ia akan menjadi kelebihan untuk... kelebihan yang berlaku. Tetapi... saya bermaksud semua mereka, semua pembentangan PNP mereka... mereka sudah mengambil kelebihan untuk... menjadi sebahagian daripada kelebihan. Tetapi untuk... seperti itu, mereka... pembentangan PNP perlu menjadi lebih... berkomunikasi perkataan untuk kelebihan itu juga. Betul, betul. Ya. Kemudian apa tentang Michael dan Zaryn? Apa yang kamu akan... ambil pada perkara ini? Memang banyak perkara ini. Kamu fikir ia berguna? Pada pembentangan itu, ia berlaku seperti... kelebihan kelebihan kelebihan kelebihan. Jadi sebenarnya hari ini, kita mungkin mengawal... kelebihan atau kelebihan... dari... kelebihan kelebihan seperti itu atau hanya kelebihan untuk kelebihan kelebihan. Ya. Jadi itu adalah pertanyaan. Saya ada pertanyaan. Teruskan. Jadi... saya rasa mereka akan juga... saya tidak benar-benar bersyukur tentang ini juga. Kerana seperti saya masih melihat... saya masih melihat... semua orang bergabung dengan itu. Mungkin Michael tahu... lebih baik pada... kelebihan kelebihan kelebihan. Kerana saya... Ya. Kerana saya masih melihat... semua orang lain... masih sangat bergabung dengan... sesiapa pun yang... telah dibuat atau... Jadi saya rasa kelebihan kelebihan itu... adalah seperti sebuah... kelebihan... kelebihan kelebihan kelebihan... di dunia dan... Hey, ini adalah kelebihan yang kita akan ke. Dan kelebihan seperti itu... kita akan menjadi seorang kelebihan. Apa yang... seperti itu... untuk pastikan... terserahkan kelebihan dan sebagainya. Seperti yang saya katakan, ia lebih... saya rasa... lebih kelebihan, kan? Saya... menghubungkan... link pada... chat grup, chat zoom. Saya... mencari Google pada akhirnya. Pada mesyuarat dengan... pembinaan penerbangan... Pina, Kocot. Pertanyaan terakhir... Sebenarnya, seseorang beritahu apa yang berlaku... kemungkinan... PN3 dengan pembinaan penerbangan. Jadi... Siapa yang beritahu? Adakah anda mahu... berada di link dan berkongsi... berkongsi di sini? Ya. Tunggu. Tunggu. Kenapa? Kepungi. Saya rasa... saya rasa saya perlu berhenti berkongsi... untuk melihat sesuatu. Sama-sama. Kamu balik ke mesyuarat itu. Okey. Ah, mesyuarat itu. Okey. Tunggu. Okey. Ya, mesyuarat itu. Mesyuarat itu. Ya. Okey. Jadi, di sini, kami berkongsi. Ya. Derek adalah... Derek beritahu... adalah pengalaman penerbangan... untuk... Php... 7.4. 4? Ya. Ia berkongsi selama 3 tahun. Sehingga EOL, kan? Ya. Ia berkongsi... sehingga pengalaman penerbangan... pengalaman penerbangan. Sangat menarik. Jadi, ini adalah... sebuah ruang yang dia bermain... untuk mendapatkan perkara yang benar. Sebenarnya, ia berkongsi selama 3 tahun... yang akan berkongsi... dari penerbangan... atau... dari penerbangan... dan untuk mendapatkan semuanya... ke dalam hidup. Ya. Jadi, saya rasa ia... ia berkongsi... seperti... bagaimana... ia berkongsi... kordinasi. Hmm. Ya. Ya, dan ia akan... berkongsi... berkongsi... Sangat bagus. Saya rasa ia berkongsi... ia berkongsi... berkongsi, seperti yang saya katakan... lebih banyak orang di komuniti... dapat berkongsi dengan membangunkan perkara ini. Ia lebih berkongsi... untuk... pada penerbangan... pada penerbangan. Jadi, saya rasa ia bagus. Sangat bagus. Jadi, hari ini... anda akan bercakap lebih banyak tentang... perkara yang anda berkongsi... untuk versi 8, kan? Saya rasa... dalam... seperti beberapa bulan... bulan lalu, apabila kita bercakap tentang perkara RFC... yang tersebar... seperti... banyak perkara yang sudah dikatakan. Saya lihat. Ya, jadi... apa yang kita akan bercakapkan akan... terutamanya tentang... masa depan. Baiklah. Lebih baik daripada perkara... perkara yang akan berkongsi 8.0. Ya. Mari kita lihat. Baiklah. Ya, perkara ini... ia sedikit... susah untuk menggunakan. Bagaimana anda melihat perkara yang berlainan? Tidak. perkara ini seperti... menggunakan... okey. Zoom... menggunakan saya. Oh, saya boleh menggunakan. Boleh menggunakan. Oh, okey. Ya. Oh, maksud saya... Ya, saya dapat menggunakan. Kerana ia di atas, saya tak dapat... Pada masa depan, saya... mengubahnya. Jadi saya tidak berhenti menggunakan perkara yang berlainan. Ya, ia adalah... sebenarnya akhirnya tahun ini. Desember tahun ini. Pada masa depan, keadaan... keadaan... keadaan... keadaan... Oh, keadaan generasi. Ya. Alfa itu akan datang... sebentar lagi, saya rasa. Ya, kemudian... jadi mereka pergi ke... sekitar satu, sekitar dua. Saya rasa yang... terutamanya ia akan... ia akan... ia adalah... perempuan nama... Ya, saya ingat. Saya ingat... sebab saya sedang mencari. Tetapi... bagaimana yang saya katakan... Ya. Jadi... Ya, ya, ya, ya, ya, ya, ya, ya, ya, ya, ya, ya, ya. Ya. Jadi... pertama pilihan yang terbaik... dalam pilihan yang terbaik... ia adalah... Sarah. Sekarang saya... menerima... menerima... kebanyakan yang terbaik... seperti 33. Saya rasa... dia... saya... saya tidak tahu. Ya. Kemudian selepas itu... ia adalah... pilihan yang terbaik... sebagai pilihan kedua. Ya. Kemudian pilihan ketiga adalah... pilihan ketiga adalah... pilihan... ketiga... ketiga adalah... ketiga, saya rasa. Kemudian pilihan kedua adalah untuk... kerana ia adalah... pilihan yang terbaik. Itu yang berlaku. Jadi untuk pilihan kedua, yang adalah pilihan yang terbaik... ia adalah... sangat kena. Ia adalah... pilihan yang terbaik, saya rasa. Ya. Jadi ini... ini adalah... ini adalah pilihan yang terbaik. Semua orang berjaya. Semua orang berjaya. Jangan... kita berjaya dan semua orang berjaya. Sebelum daripada Derek, saya tidak fikir kita pernah melihat dia di sana. Ya. Ya. Sebelum daripada Derek. Ya. Ya, nama lain seperti... orang yang tidak tahu. Saya rasa komuniti telah bergerak... dan dapat... lebih banyak orang berjaya. Jadi yang bagus. Saya rasa lebih banyak orang... lebih banyak orang di timbulan internas. Yang baik. Mereka sepatutnya... panggil timbulan, bukan? Ya. Jadi... Sekarang ke beberapa RFCs... yang saya mencari. Jadi yang pertama... salah satu adalah... menerima di... PSP 8.0 sudah. Ada... kita bercakap tentang ini sebelumnya? Saya rasa kita tidak, bukan? Pemotongan kontrak... propotif. Okey. Ya, jadi... yang ini... sudah diterima seperti... di... PSP 8.0. Jadi... apa yang membuatnya... ini, betul? Pemotongan... seperti ini, kontrak... ini sedikit sulit untuk menjelaskan. Nampaklah yang pertama... peraturan di atas, yang paling mudah... yang diberi di atas. Tidak, tidak. Okey. Jadi ini... jadi ini adalah aplikasi... mereka perlukan... semua keperluan, bukan? Jadi ini adalah... jadi salah satu proposer... adalah... sebuah... hanya di bawah. Ya. Sebenarnya... sebuah perkara, bukan? Ya. Ya, seperti bagaimana... bagaimana banyak ini? Terlalu banyak. Ya, jadi ini adalah... Ya, betul. Ini akan... ini seperti... seperti... Colin. Oh, okey. Ya. Kerana... Colin juga sesuatu seperti itu. Tetapi mereka berkata... tanpa membuatnya kontrak... membuatnya di sekolah, di sekolah... di sekolah kontrak. Ya. Maksudnya... dan mereka memilihnya kerana... ia dipakai daripada... bahagian kandungan kandungan. Baiklah. Jadi kamu memperkenalkan... kamu memperkenalkan skop dalam inisialisasi... dalam... Ya. Saya melihat... jadi jika ia tidak sepatutnya menjadi publik lagi, kamu boleh berubah untuk... melindungi atau memperkenalkan, bukan? Ya. Jadi mari kita masuk. Seperti apa yang... kontrains... apabila ia memperkenalkan... kamu juga boleh membuatnya secara pribadi, saya rasa. Tidak, tidak. Jadi jika ia memperkenalkan... jika ia memperkenalkan... jika ia memperkenalkan semua fungsi... juga tidak boleh. Jika ia memperkenalkan interface juga tidak boleh. Jadi hanya dalam proses komplek. Ya. Kerana interface tidak mempunyai... kota pertama, bukan? Tidak. Jadi... saya tidak fikir kamu boleh... memperkenalkan... kelas aplikasi. Saya rasa ini adalah... pribadi. Ya, sepatutnya... ia tidak memperkenalkan aplikasi. Saya rasa ia sepatutnya baik-baik saja. Apabila publik atau protektor, ia sepatutnya baik-baik saja. Terima kasih. Tidak. Tidak, tidak. Jadi saya akan beritahu. Jadi jika kamu melihat kelas aplikasi... di daripada kontrains, parameter yang memperkenalkan... hanya akan memperkenalkan... bukan kontrains aplikasi. Untuk kontrains aplikasi. Bukan sebab saya fikir, ini adalah aplikasi. Jadi apabila kamu menggunakan aplikasi, sebenarnya ia akan mengambil aplikasi... dan kemudian mengambil aplikasi... pada instans. Tetapi... fungsi, aplikasi aplikasi dan aplikasi... tidak dapat mengambil aplikasi sendiri. Ia tidak dapat... tidak dapat mengambil aplikasi sendiri. Ya. Jadi tidak boleh... tidak boleh membuat... tidak boleh membuat aplikasi sendiri. Jadi tidak dapat berminat... untuk membuat kerja pada tiga... tiga-tiga. Ya. Jadi dalam kelas kongkik... apabila... seorang pengguna boleh berkata... dollar X sepatutnya... peribadi... dan... kemudian ia akan bekerja. Kemudian parameter permainan... boleh diluncurkan... sebagai perubahan... pada instans yang dibuat. Ia... Ia bermakna, sebab... kita perlu mempunyai... instans di tempat yang terlebih dahulu. Ya, sebabnya... ia menyebabkan... keadaan ini, bukan? Ia tidak... Jadi jika kita melihat di atas, tempat yang terlebih dahulu, anda melihat keadaan ini, bukan? Ya. Ia adalah... adalah sebuah... yang terlebih dahulu. Ia... Oh iya. Ya. Ia adalah... Ia ada instans... sudah... yang... yang tidak mempunyai... tidak boleh membuat instans. Ya, anda boleh membuat instans di atas. Ia adalah instans. Ya. Baiklah. Ia adalah... ia adalah... ia adalah... ia adalah... ia adalah... tidak mempunyai instans ini, saya rasa. Mari kita lihat. Apa yang saya katakan? Baiklah, ia tidak mendukung. Baiklah? Baiklah, Puan. Saya juga mengatakan Baiklah. Baiklah. Ya. Kerana sebab saya mempunyai keadaan, sebenarnya Baik tidak bermaksud banyak. Sebenarnya OOP, anda mempunyai keadaan yang terlebih dahulu. Anda perlu mengambil... keadaan yang terlebih dahulu. Terutamanya... keadaan yang terlebih dahulu. Baiklah. Baiklah. Saya lihat. Ini sangat menarik. Tidak. Sebenarnya, saya tidak boleh mengalami keadaan yang sama. Baiklah. Baiklah. Saya bermakna tidak mengalami keadaan lagi. Baiklah. Tetapi... saya ada masalah dengan ini. Sebenarnya, untuk keadaan yang dikenali, saya akan membuat keadaan oleh keadaan... keadaan yang dikenali oleh... keadaan yang dikenali oleh keadaan, keadaan yang terlebih dahulu. Jadi, segala perubahan, dan keadaan yang dikenali. Jadi, dalam kes ini, jika anda tidak dapat mengalami keadaan, jika anda ada sesuatu yang mengalami keadaan, setelah itu anda perlu ingat tapi kita lihat kelebihan untuk melihat apa yang lain ada yang mungkin So you can PHP.blocks, right? Yes, correct. But let's see if you want glance, you want to find out all the public properties, right? You need to look at the top of the class as well as remember to look at the constructor So just something to think know Ya It is not possible to use tolerables because it is not Okay, this one is it's a no brainer kind of because it's like it's not part of the type properties yet, I think I remember this was like the previous like When was this? This was very long ago I thought it was a callable type I thought it was a callable type See, this one when it was introduced for the type when the type of properties was introduced talk about how how callables will not be supported but You can search for the word called Oh Ya Oh, okay Ya Cool So I hope with this we have shorter constructors Ya Let's boilerplate It's quite cool Ya I don't know I'm somewhat of a purist of making things explicit so this not being able to do the setup I guess it's a good thing it improves I guess it does improve the readability a bit la Ya just that there will be a indirect side effect as in so you're not familiar with this syntax and you see this funny thing in the constructor why setting a scope in the constructor which kind of makes it Ya, but I guess you think about it, it actually makes sense because you're now setting the I mean you'll be setting this you'll be touching this you'll be setting this props to the local scope anyway to the disk.props anyway, so I guess making it explicit in the constructor makes it actually easier to grok you know, okay immediately okay this will be available in the public scope or private scope or whatever scope la I guess Ya Okay Let's see what's next What else is there? Variety parameters cannot be promoted Oh Oh, so the I see No splat la Can not splat The tongue of it Can you you can cheat around that la but I guess ya you can pass in a hash and then do the pass in an associative array use some magic to turn your associative array Well, we can just declare as an array Ya, you can So For this one I think you can take multiple arguments and then you'll be inside the constructor to become an array la but when someone you can pass multiple arguments and you'll be all consolidated string So in this case, the string is actually an array la not rather than the dollar sign string Ya, when you actually read it this kind of constructor is an operation as well Ya So I guess Just do not do the spreading then just Yes, array and then ya So Entah ya Ya Ya Ya Ya Ya Ya Ya Ya Ya Ya Ya Baiklah. Jadi, ia adalah suara sintetik? Ya, dan suara suara. Mereka mempunyai kemungkinan dan kemungkinan. Ia adalah sebuah tangan yang panjang. Jadi, saya tidak tahu, seorang individu hanya mempunyai segala-galanya? Ya. Ini adalah sebuah kemungkinan yang mungkin untuk memperoleh ekspresi arbitri dalam parameter 38. Baiklah. Baiklah. Saya rasa anda boleh melakukannya dengan kemungkinan yang biasa. Ia adalah kemungkinan biasa. Ya. Kerana ia hanya suara sintetik, bukan? Ya. Tidak. Pada kemungkinan ini, apa kata itu? Mereka akan berakhir untuk memperkenalkan kemungkinan. Jadi, perkara itu adalah, pada kemungkinan ini, biasanya kita akan memperkenalkan kemungkinan, kerana kemungkinan baru. Ia akan seperti itu. Dan kemudian, konstruktor, kita akan memperkenalkan kemungkinan dan memperkenalkan kemungkinan baru. Jadi, sebenarnya ia berlaku, ia menjadi, jika seseorang tidak memperkenalkan kemungkinan, atau jika seseorang tidak memperkenalkan kemungkinan, ia menjadi perubahan. Kita dengan alguns perkara ini. Yang pertama, ia akan memperkenalkan kemungkinan yang saya katakan. Saya akan memakan ini. Jika saya akan meminta enqu시, saya akan meminta hubungan yang mortu menerima kemungkinan yang saya katakan. Saya akan meminta hubungan yang ini. Masa itu, saya akan meminta hubungan, kita akan meminta hubungan. Jika anda melihat langkah pertama di atas kain, ia berlaku dalam stik inisialisasi. Ya. Jadi ini berlaku dalam stik inisialisasi. Sebenarnya sekarang. Ya. Dan kemudian, pemeriksaan pembinaan ini akan menyebabkan kepercayaan. Jika pemeriksaan pembinaan ini akan menyebabkan kepercayaan, kemudian pembinaan ini akan menyebabkan kepercayaan. Dengan pemeriksaan, okey. OMG, wow. Jadi kita gunakan pointer. Ya, itu pointer. Dengan pemeriksaan. Okey. Okey. Mereka memang bukan penyebabkan pasangan, tapi okey. Mereka akan menyebabkan. Pemeriksaan pembinaan ini akan menyebabkan kepercayaan. Sebenarnya, ia mungkin menyebabkan kepercayaan dan kepercayaan. Pemeriksaan untuk menyebabkan kepercayaan. Okey. Okey. Okey, kita boleh membeli kepercayaan. Bagus. Pemeriksaan ini adalah fungsi baru, bukan? Tidak mengapa. Sebab itu, ia sepatutnya sebabnya. Ya, ia... Ia hanya sebuah kepercayaan yang mudah. Ia bukan sebuah kepercayaan. Jadi, kamu akan menyebabkan kepercayaan jika itu tidak benar. Jangan lupa. Sebenarnya, ia adalah kepercayaan. Mereka akan menyebabkan kepercayaan. Ia adalah kepercayaan. Sebenarnya, ia adalah kepercayaan. Oh iya. Jadi, kamu akan menyebabkan kepercayaan? Ya, ia adalah kepercayaan. Kamu akan menyebabkan kepercayaan? Ya. Sebenarnya, ia adalah kepercayaan. Oh. Okey. Kamu akan menyebabkan kepercayaan. Saya melihat kepercayaan. Bagus. Ia adalah kepercayaan yang mudah. Jika ia benar, kamu akan menyebabkan kepercayaan. Jika ia benar, kamu akan menyebabkan kepercayaan. Ia tak ikut kerja. Ia tidak lahan, kamu akan menyebabkan kepercayaan. Ia adalah kepercayaan. Dan makphen dan jika kamu telah menikmati kepercayaan. So basically it's like a debug only for debugging purposes is not meant for production applications to use. I guess you can set a ZEN, a SERT. Okay, that's cool. Oh, so I was going to ask about annotation. Okay, so along this, along this for this RSC. Reflection. Okay. Okay. So. If we comment down here. So the dot block parameter is true. Together with the parameter. So after desugering, you will see the normal dot block and the normal property on top. You will see the normal annotation. After desugering. So what it means is it will look like a. You look at the final syntax. Yeah, it will look at the final desugert syntax and. Okay. Additionally, two new methods is promoted. Returns true for properties that have been implicitly generated as part of construct. Promotion. Returns true for parameters that have been resulted in. Generation of an implicit property as part of construct. Okay, let's let me try to understand this. So it's a difference between the property and the parameter. The parameter is probably talking about method parameters. The property is talking about class properties. So when you run reflection on a class, right? There is a, okay, these are all the public properties. Then every property you can check is, was this. Oh, yeah, yeah, I understand now. Was this part. So parameter is actually talking about the parameter. The method parameters for the constructor. Or any method. Okay. Inheritance. Promotion can be used in conjunction with inheritance. But has no special interaction with it beyond what is implied by the D-Schooling. The chemical use case involving inheritance is shown in the following based on the Syntax 3 representation. Okay. Okay, let's see. Attract class mode. Contract location and start location and location. Oh, okay. So that means it's basically, what it means is inheritance. It's inherited. Oh, okay. I was wondering about that. They can use the promoter parameter. So it's, so this thing doesn't, this arrow property doesn't apply. So when they call a parent constructor, the parent constructor, the node class, will actually create two project properties. Yeah. And then, yeah. In this case, there's no, there's no need to re-declare the protected. Yeah, yeah. Okay. It also helps, I guess. They show the D-Sugar Syntax much easier to see. Let's see. Okay. Oh, this is the D-Sugar. Wow, super long. Oh, okay. Now when you have an operator, then you really see the difference in the boilerplate. Wow. Yeah, this is, this is really low. Okay. But it does kind of, it does kind of make your constructor, it kind of encourages you to make multi-line constructor arguments, right, like this. Yeah. So typically, there shouldn't be so many parameters in the constructor. Well, you shouldn't. Okay. I guess this example is kind of contribut. But ideally, if you're in a production situation, you will probably pass in an array instead of, these are so many arguments, right? Or type, type. But the downside of passing an array would be that it's type definition is not. That's true. It's not something that you can reference unless you do like a php. per se. So you will know what is passing. Okay, I guess you're right. I guess it's better to be explicit and to be implicit. I choose that kind of evil over, I usually choose that kind of evil over using of arrays. Yeah, I guess if you pass in as arguments, I guess you can type in or you can pass in one value object that encompass all these properties inside. You can also pass in a data class. Yeah. Okay. It should be noted that property assignments happen before the parent constructor is invoked. We should probably This is why you see in the example above that it would make you explicitly initialize the parent class. We will go further up in the example. The parent construct. Okay. What else is there for this one? Okay, attributes. Okay, let's see. It also introduces we need to consider how these features in the right attributes are a lot on both properties and parameters. Do we take a look at this one first? Yeah, I think we haven't mentioned it before. This one was also like let me close the other stuff first. Wow. Okay. So it's Syntetical mental data to the declaration of classes properties. Similar concepts, annotations in Java. Attributes in C sharp. C++ Decorators in Python and JavaScript. Okay. Kind of like double spaceship so Oh, no. Okay. My title in Chinese No one of those book titles in Chinese always call this anger. Examples of attributes do they have any example like what kind of attribute are we talking about? They have a full attribute. Is that if that counts? So an example attribute is this class full would be an example attribute. So if another class Oh, you can even you can initialize by the annotation itself. Okay. I pasted link in chat. So how attributes could be used. Okay. Let's see. Okay. So it's like I think Andrew also is like the when you make GTP request it can actually put attributes to specify whether to get method the URL the those are called invocations. So this is a bit clearer. Kat is calling you. Yeah. Yeah. So I guess this is how it will look like. And the construct is down here. It accepts event of a type string. Alright, so What? Listen to So this is a string? Yeah. What? So method and usually use attributes or macros or annotations to introduce new functionality to kind of like inject new additional into a function or into a class, right? So I guess in this case once you declare it and set it here you will be introducing some new functionality inside. So these are like the examples of it. Yeah this is like you know all this usually we would use traits for now I guess we have like traits where we call use something and then within the constructor or whatever we call those methods within the constructor itself Yeah Yeah that means I just need the right controller and then I put a attribute there automatically the route will be configured I don't even need to write in some config to actually create a route Yeah Yeah The downside would be would there be any downside to doing this It's not really per-say at the first glance I think This would give more context so normally like your controller should be in some folder and then your route config will be in some other folder It's like you have to remember but over here you see everything the context is already so yeah in a way the bad side I could see is that let's say you want to rename the route like one of the so called directory of the route then you have to if let's say it's in a different controller then you have to go down to the other controller Yeah like in this case where it is a controller itself like a create controller so you have to go down to the create controller You also have to rename products to something else you have to go down to products Create read So read you have to go down to products read controller then you go and change it or go and compare but of course you can also argue that if you are changing something like that already then you might also be changing the class so okay so we sort of understood what is that let's go back to our okay let's see without argument single argument, few arguments so basically all this attribute and the promoter parameters it's all basically to reduce boilerplate or it's how you add multiple attributes or I guess multi line or single line how do you do annotations in Java for example name spacing okay cool so now we know about attributes quite a lot of interesting things you can do with it I think that's quite extensive ya it's like how in spring boot when you have annotations you add a lot of additional voodoo magic into the spring boot so same goes for decorators in python you add a lot of magic into it which sometimes can argue it adds a lay of in direction I guess okay let's talk a bit about the compiler and user compiler attributes spall data user line attribute spall data during reflection api okay look at the PHP example it's easier okay okay understood now it's like reserve word this actually hurts the brain to to have to think so much I think it's best to put it one side until you actually delete I think we'll leave this to the framework framework developers to use it I think as developers as developers ourselves will write code for people who I don't think it's unless you're really really huge we'll actually get to the point we'll actually get to use this yeah I suspect this will be very handy for framework developers like symphony and larval then they can basically use this as a way of removing a lot of boilerplate that you would need to get things done la I think if I've seen that I've seen this in practice in Django as well as in Spring Boot so so basically I think you'll probably go the same way I think it's a nice addition to the PHP language itself the ability to use something like this although personally I would probably prefer if they've gone with a more conventional approach like with decorators and annotations it's usually an ad sign right ad and then followed by the thing actually they have if you scroll there's a scroll down below they call it a smart so it's an ad colon it's this is the voice it's actually would be in RFC choice of syntax would be secondary vote yeah the ad sign would be closer to how other languages or frameworks use it Java uses an ad sign I think decorators will use an ad sign I'm not sure I think only TypeScript uses decorators I've not seen it in Java script I've seen it in TypeScript but not in Java script so yeah it would be interesting personally I would prefer something closer to how other languages ad sign double spaceship I don't know it would be unique it would be unique to PHP but for other people coming from other languages it would not be very familiar it would be like what the hell is going on here I'm still trying to get you over the fact you're using forward slash as namespace or is it backslash you get used to it after what you get used to forward slash you get used to it after a while so it's fine the namespace one is backslash backslash oh yeah backslash it's like that so you think of the graph y equals s and y equals minus x I see anyway so still okay anyway that's just my opinion but anyway moving forward but I like that it's the split RFC into what it's supposed to do and syntax into a separate board so so confused well distracted cool now we want to look at how this sugar is okay let's see so we have this right and the attribute is the coach could this sugar in one of the follow ways apply to parameter apply only to implied property apply both to parameter property attributes on promoter properties are forbidden due to ambiguity okay let's see option one apply to only parameter apply to property okay RFC just using option three so applying both to the parameter and the property itself which one do you prefer I think three should be the best I guess because it covers most of the use cases like you will have to have a sorry yeah but if you are looking at writing the same test without the promoter parameters how would you usually write it actually it will be option two and I don't know you might need functionality in the constructor itself somewhere in the constructor you want to review something so suppose let's say in the constructor the thing is right supposing you have attribute to create a route in option two the route is only created once but in option three the route may be created twice may be in fact we cannot say for sure or let's say run some listener or run some trigger some event I guess it depends on the type attribute you're passing in I guess yeah so in this case give too many choices may not be that good but to me it's like if I were to use attributes purely parameter option two will be hard you will be able to kind of guess if it's property or parameter when you are using when you are using attributes in PHP yes so actually at the bottom just after this code block it says about the ease promoted they will actually tell you you can actually use this promoted to decide better you have to apply attribute if it's a property or parameter but this is implementation detail as I said so it's really up to the framework if you are using it extensively throughout the framework code yeah it's what you say it will be just to place attribute only the property we should be open to such a change yeah just like previously where they have promoted parameter equals new dependency that is only run in the constructor that is not translate to the declaration so so the properties are initialized so same thing piece of code the instantiation is only run once right wow, it's run already cool so you only look at 2Rs this is very cool so actually we got enough covers for every beta just discuss what I will see yeah I actually intended to look at like several other one but I guess we can cover those in the later meetups so actually it's better to go deep do no skip the surface it's better to go deep what's more value to whoever is listening to this right now yeah, I guess it will be sometime before this gets into the into the public public release right so I guess it does give people some time to think about it which is nice cool this section gives non-normative coding style recommendation if constructor property promotion is used it is recommended that the constructor be placed as the first method in the class and directly following any explicit declarations this ensures that all declarations are grouped together and visible at a glance coding standards that currently require static methods to be placed first should be adjusted to place the constructor first so that's what I mentioned so it's like so that you can easily at one glance all the public properties is this the PHP.blog they recommend it copies the the.blog parameter oh, it doesn't it only copies the.blog if the.blog is put on top of the parameter itself this is the method.blog this is not the parameter.blog so this this is not for the method this is not the.blog for the parameter so you get the sugar into that though no so at the when you go on the way to the top when you show the sugar syntax they will they actually show when they put the.blog on top of the parameter and then when it's the sugar that.blog for the parameter is copied over it will show just now at the top of the page so this is just normal method.blog normal method.blog oh, wait sorry okay but this is handled by the PHP documentation tooling you look at the description this is not this is not the sugar syntax by the PHP parser yeah i don't think they will spend so much time to go and copy over because you don't want to do it you don't want to do it in runtime or you don't want to do it in compile time no for reflection purposes for reflection purposes i think should be done by the documentation tooling but you shouldn't do it at compile time because you have to it they still need to extract syntax tree so actually the thing is already inside the abstract syntax tree so the thing is it is okay for the PHP do i call it compiler or parser we have a parser to actually copy the dot blocks for the parameter but it is not okay for the PHP parser to go and single out the individual license the one that you highlighted match it to the parameter so that's that's what i'm trying to say finally it should be noted that the constructor property promotion is just a convenience short hand notation that covers most use case a promoter property can always be converted into an explicit property this one is already said earlier alright this other because i it's called in as well i know then that's cool i didn't use hack before that's why i didn't know it wasn't i think i slowly bring over all the functionalities in hack into PHP by the way just for information so the time i was interviewing to become a tutor at scope computing so i had to give presentation like show how i teach so actually later on he actually he actually pointed out one mistake i made i confused metaparameters with metapargubans so he was quite insistent on it will be consistent in how you define it metaparameters are what you see in the decoration of the method in the method signature metapargubans is when you call it those things that you pass in those are the arguments but the method signature itself as in the part where you declare it those are referred to as metaparameters metapargubans is what you refer to when you call it understand now okay so let's say i have let's say i have a function called test and then it takes a it takes a variable call x to function test it takes a variable called x x is the method argument so method parameter now later on when i call it i call test bracket 3 the 3 is referred to as a method argument oh okay so the time you call it missaj so now okay i have to be quite careful when i speak of parameters so let's say let's say so who it was a really i said so it's okay okay wow almost unanimous alright people who are listening to this podcast learn about promoted what is it called again promoted arguments constructor constructor promotion so yeah i forgot it should be constructor promotion yes constructor property promotion so it's coming to php8 so better beware and know what it's all about cool we have come to one hour point and i think we pretty much have exhausted our listeners yeah i think we should wrap it up so let's talk about you all like this and will you all use it or not zion zion first do you like it and will you use it it actually be most a lot of it really really be most a lot yeah so if my constructor is a very simple constructor like like what you see on the top here but normally if i do other things my constructor then maybe no it really depends it will take some time to actually get used to and usually i like to put all the dog blocks out of annotation then actually i will see my constructor bloat up a lot yeah i agree with zion it seems like your constructor signature would basically become quite bloated and big but i guess in the long run you are basically moving a lot of the boilerplate into the method constructor or rather the class constructor so in a sense it's one place to document the things that your class would have like all the public methods and maybe even some of the dog blocks that need to come together with this argument this parameters so i think that would be quite interesting i think it's i guess fat constructors are here to stay so yeah before we get the times i think it's a good thing so as long as it reduces the code you need to write i think from developer's point of view i think it would be a nice thing to keep it i guess it's nice to keep the scope closer to the declaration so you know that it's what it is what it's actually doing but it does refuse a bit like java-ish refuse like bringing some java-ish kind of things into this okay i guess it's not that it's a bad thing i think i won't use it if i have other public properties that are not in the constructor or other or other so which means your constructor method need to then do additional things as in if you're passing in stuff that's not meant to be promoted like they're meant to be private methods or doing like transient variables then you probably need to then add some stuff into your constructor instead of do stuff i guess you can mix and match you can like pass into 2 arguments that are meant to be promoted and the rest not really meant to be promoted and you just use it as transient variables in the constructor and then throw away so it's like i prefer to declare my variables in one place so it's either i declare all the public properties outside the constructor or i declare that all of them inside the constructor as for property promotion but that's a personal preference la i think it will be quite confusing if we have like some declaration in the constructor and some of them is outside like say you have like 2 or 3 other public methods of public attributes that are not declared in the constructor then you have like half-half you have a mixture of stuff that's in the constructor and then you have stuff outside of the constructor so pros and cons i guess i guess if that's the case then you probably want to revert back to the old de-sugar kind of approach ya as for myself i've been doing call in and typescript for i think a while already call in at least a year then typescript at least few years already so like this is this doesn't feel out of the norm at least for myself right ya because i use the 2 other languages and they most of the time i declare the variables in this shorthand syntax manner ya great so ya awesome i mean it's good to know and look into the magic eight ball and figure out what are the new things coming up in the near future so i guess if a lot of new things coming up it will be nice to be in the know so at least it won't be strange to you when you actually start using the newer version of php so when is php when is php december it's not too far away though so it's not bad but the alpha release should be soon isn't it or soon first of all i remember currently the alpha release but in any case if i get the email then i will send it to our php telegram group if you are in the telegram group you will be one of the first to know when the alpha will get release true true you have to show the link is it possible to show the link i don't mind if we put it in the show notes can link it in the show notes anyway so that's us the Singapore php podcast so we have zion and hui ren and myself and michael so three of us carry on this php thing so we welcome guest in our podcast so if you are interested in joining us in the future podcast drop us a line in our meetup group we are available on meetup.com you can find us there and you can also follow us on twitter php singapore so yeah that's us and till next month or rather till our next episode see you all soon and recording