Tap to unmute

PHP Type Declarations: make your PHP code easier to read, and simpler to use

  Рет қаралды 5,182

Dave Hollingworth

Dave Hollingworth

Күн бұрын

Пікірлер: 35
@s3raph443
@s3raph443 Жыл бұрын
Спасибо 🙏💕
@emperoroftheearth3215
@emperoroftheearth3215 3 жыл бұрын
The way you explain is amazing and easy to understand.. thanks
@moraaoo4889
@moraaoo4889 Жыл бұрын
the was the third video to me about this to watch, and the first video make me understand :)
@surfer_silver
@surfer_silver 4 ай бұрын
I actually love dynamic typing. It's great.
@persiansayed
@persiansayed 3 жыл бұрын
Great explanation! Thank you.
@karenmelikyan377
@karenmelikyan377 2 жыл бұрын
The simplicity of explanation speaks of high professionalism. Good job! Thanks.
@alan-overthenet
@alan-overthenet 3 жыл бұрын
Excellent, Dave, thanks a lot.
@giorgiobarone9784
@giorgiobarone9784 3 жыл бұрын
As always a great apportation by you
@sameera-dananjaya-wijerathna
@sameera-dananjaya-wijerathna 3 жыл бұрын
good explanation ! thanks !
@NedumEze
@NedumEze 5 ай бұрын
Please, will the ?string $username apply to the parameter passed to a Constructor for initialization?
@dave-hollingworth
@dave-hollingworth 5 ай бұрын
I haven't tried it but it should be, yes
@NedumEze
@NedumEze 5 ай бұрын
@@dave-hollingworth Thank you sir
@_Mikekkk
@_Mikekkk 7 ай бұрын
What php editor do you use and how do you run this code in command line?
@dave-hollingworth
@dave-hollingworth 7 ай бұрын
Visual Studio Code, running the code using the regular command prompt application. You can run interactive PHP with the -a flag, e.g. php -a
@sergey_gabrielyan1001
@sergey_gabrielyan1001 3 жыл бұрын
Hello, I want to know, is it possible to give type hinting to roles and permissions separately? public function getRoles(): array { if (Gate::allows('role_access')) { $roles = Role::with('permissions')->orderBy('id', 'DESC')->get(); $permissions = Permission::all(); return [ 'roles' => $roles, 'permissions' => $permissions ]; } }
@dave-hollingworth
@dave-hollingworth 3 жыл бұрын
I'm not sure what you mean - you can add type hints to only individual arguments or return values, you don't have to add them everywhere if you don't want to.
@sergey_gabrielyan1001
@sergey_gabrielyan1001 3 жыл бұрын
Thank you so much
@acos21
@acos21 3 жыл бұрын
What font is this?
@dave-hollingworth
@dave-hollingworth 3 жыл бұрын
In the editor and on the command line, DejaVu Sans Mono
@andrew.schaeffer4032
@andrew.schaeffer4032 2 жыл бұрын
Thanks for the helpful video! I'll probably be taking your courses and wonder if you have any suggestions for learning Apache? It keeps coming up, and I think it'd make my life a lot easier if I understood it instead of just guessing and copying code.
@dave-hollingworth
@dave-hollingworth 2 жыл бұрын
Once Apache is installed, you don't usually need to configure it much, especially if you use something like XAMPP. There's a good tutorial here though if you're interested: www.guru99.com/apache.html
@andrew.schaeffer4032
@andrew.schaeffer4032 2 жыл бұрын
@@dave-hollingworth Thanks!
@johnydevlin
@johnydevlin 2 жыл бұрын
why did you write "Course" near $course. What is it called and what is its purpose.
@dave-hollingworth
@dave-hollingworth 2 жыл бұрын
It's the type declaration for the Course class. It declares the function argument as an object of the class "Course"
@johnydevlin
@johnydevlin 2 жыл бұрын
@@dave-hollingworth Thank you sir 🙏
@johnydevlin
@johnydevlin 2 жыл бұрын
@@dave-hollingworth Sir, Please make video tutorial on Laravel framework
@ademineshat
@ademineshat 3 жыл бұрын
Thanks 👍
@mahfoudhani1252
@mahfoudhani1252 3 жыл бұрын
thank you it is well
@MobiusCoin
@MobiusCoin 3 жыл бұрын
So... I'm a WordPress theme developer so I'm not really a PHP developer. Can you do a video on the PHP interactive mode? I didn't know this existed until now lol.
@dave-hollingworth
@dave-hollingworth 3 жыл бұрын
Ok, will add it to my list!
@marcinzawodnik6317
@marcinzawodnik6317 3 жыл бұрын
👍
@DigitalDuty
@DigitalDuty 6 ай бұрын
ဆိုလိုရင်းကို နားလွယ်လွယ်စေသည့်ဖန်တီးမှုတစ်ခုပါ
@mohamedab6440
@mohamedab6440 3 жыл бұрын
Error Number: 1054 Unknown column 'category_table.*' in 'field list' SELECT `id`,`autor_name`,`title`, SUBSTRING(`content`, 1, 300) AS content,`image_url`,`show_first`, `date_creation`,`views`, `featured_for_menu`, `category_table`.`*` FROM `aricle_table`, `category_table` WHERE `aricle_table`. `id_category`= `category_table`.`id_category` ORDER BY `date_creation` DESC LIMIT 7 OFFSET 0 Filename: C:/xampp/htdocs/ArabicBlog/system/database/DB_driver.php Line Number: 691
@dave-hollingworth
@dave-hollingworth 3 жыл бұрын
The wildcard character * doesn't need delimiting - so instead of `category_table`.`*` use `category_table`.*
@mohamedab6440
@mohamedab6440 3 жыл бұрын
@@dave-hollingworth Thank you
The difference between use and require in PHP
3:48
Dave Hollingworth
Рет қаралды 4,6 М.
Tuna 🍣 ​⁠@patrickzeinali ​⁠@ChefRush
00:48
albert_cancook
Рет қаралды 148 МЛН
99.9% IMPOSSIBLE
00:24
STORROR
Рет қаралды 31 МЛН
Beat Ronaldo, Win $1,000,000
22:45
MrBeast
Рет қаралды 158 МЛН
PHP doesn't suck (anymore)
10:48
Aaron Francis
Рет қаралды 213 М.
When to use Traits, Interfaces, and Abstract Classes in PHP
15:08
Andrew Schmelyun
Рет қаралды 25 М.
10 Design Patterns Explained in 10 Minutes
11:04
Fireship
Рет қаралды 2,4 МЛН
How to call APIs from PHP: file_get_contents, cURL, Guzzle and SDKs
25:14
Dave Hollingworth
Рет қаралды 44 М.
What's New and Exciting in PHP 8.4
9:58
php[architect]
Рет қаралды 16 М.
CodeIgniter 4 and PHP MVC basics: controllers, views and layouts
24:50
Dave Hollingworth
Рет қаралды 41 М.
Tuna 🍣 ​⁠@patrickzeinali ​⁠@ChefRush
00:48
albert_cancook
Рет қаралды 148 МЛН