Category: backend
-
Make a PHP Package & Publish On Packagist
I was curious how composer get those packages form online.When we run a command in cmd where it goes and get that package !!Can I make a package for me? Let’s start with very basic Create a composer.json file and paste this code modify according to your package name You can also run composer init…
-
Fix Deprecated: Creation of dynamic property Class::$attr is deprecated
<?php class Ifat { function __construct(){ $this->name = “ifat”; echo $this->name; } } new Ifat(); // Deprecated: Creation of dynamic property Ifat::$name is deprecated in patha/tempCodeRunnerFile.php on line 4 class FixedIfat { private $name; function __construct(){ …
-
PHP __autoload and SPL Library.
If your site is running php 8 version and using __autoload magic method try spl_autoload_register() function. the __autoload magic method is deprecated. well you might have a question why should i use spl prefixed function? Because SPL is a Standard PHP Library. The Standard PHP Library (SPL) is a collection of interfaces and classes that…