Тёмный

Dealing with deprecations 

PHP Annotated
Подписаться 16 тыс.
Просмотров 5 тыс.
50% 1

Опубликовано:

 

10 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 10   
@whocares2723
@whocares2723 2 года назад
For any kind of depreciations, there is always an alternative. The reason why things get deprecated and then get removed is because a lot of the features that gets deprecated are unsafe to use or too old and obsolete.
@sle6423
@sle6423 2 года назад
I thought deprecations and notices were distinct things, at least when it came to error reporting?
@garetclaborn
@garetclaborn Год назад
I mean many fair points presented -- howwwweeever haha.. For all the breaking changes PHP has made since the 5.6 days, we haven't got the sort of tradeoffs that would justify them at minor versions. Feature priority is quite mysterious.. for instance the many, many, many times hopes have been dashed with RFCs attempting to bring in operator overloading, objects as keys and proper type casting. Originally coming from other languages; I strongly think these three features should have been top priority long before any of the PSR, traits or attributes were thought of. Nothing drives me to consider porting projects more than these. That, and I surely wish PHP deprecation habits were more along the lines of the Khronos group's. Perhaps alternatively if it were just more predictable; such as at X.5 versions, function signature changes may occur and at X.7 versions type changes may occur. Anything more systematic would be handy.
@Nodsaibot
@Nodsaibot 2 года назад
yeah we dont want 1gb error logs, better to disable notices
@garetclaborn
@garetclaborn Год назад
It would be nice if there was a separate alert system. One thing you can do is $catch_deprecated = function( int $error_code, string $message, string $offending_file, int $offending_line, array $active_variables ){ $DebugMode=false; static $caught = [ ]; $alert_dir = '/srv/myproject/alerts/'.$error_code .'/'; $log_dir = '/srv/myproject/log/'.$error_code .'/'; if( $DebugMode ){ file_put_contents( $log_dir . 'deprecated.log', PHP_EOL.$message.PHP_EOL, , FILE_APPEND | LOCK_EX); } if( empty( $caught[ $message ] ) ){ $caught[ $message ] = true; touch( $alert_dir . 'DEPRECATED-' . $message ); } }; set_error_handler( callback: $catch_deprecated, error_levels: E_DEPRECATED ); With this, or something very close, you end up with only a single file per error thrown unless you activate debug mode to see the full error output.
@bx_h23
@bx_h23 2 года назад
What chair are you using? 🔥
@nowieszco868
@nowieszco868 Год назад
Well, deprecations = more work for us 😅
@peristiloperis7789
@peristiloperis7789 Год назад
Not if companies start to realize that php changes can cost too much money and time. I was ok with php until it made my website useless for 20 days after an update to php 7.4.
@alexios4392
@alexios4392 2 года назад
I remember a lot of deprecations in WordPress code.
@peristiloperis7789
@peristiloperis7789 Год назад
From the developpers' point of view changes may be great, but they are terrible for business. A language update should not break applications, but that's exactly what PHP is doing at the moment. I'm a developper and a businessman and I will never use PHP in my projects again.
Далее
Generics in PHP???
54:31
Просмотров 6 тыс.
Lazy objects in PHP 8.4
34:37
Просмотров 7 тыс.
ДОМИК ДЛЯ БЕРЕМЕННОЙ БЕЛКИ#cat
00:45
PHP should be more like TypeScript
8:19
Просмотров 10 тыс.
Generics in PHP
6:48
Просмотров 16 тыс.
Deprecated Dynamic Properties in PHP 8.2
3:25
Просмотров 11 тыс.
Laravel Bootcamp: from start to finish
54:47
Просмотров 10 тыс.
Nobody Cares About Your Coding Projects
11:02
Просмотров 101 тыс.
Speed up your PHP code 10x
3:12
Просмотров 14 тыс.
Turns out REST APIs weren't the answer (and that's OK!)
10:38
Quick tip: improved PhpStorm logging
4:12
Просмотров 2,7 тыс.