PHP code example of brenno-duarte / phpdeprecated

1. Go to this page and download the library: Download brenno-duarte/phpdeprecated library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

brenno-duarte / phpdeprecated example snippets




use Deprecated\Deprecated;

#[Deprecated()]
class User
{
}



use Deprecated\Deprecated;

#[Deprecated("use other class", "2024-06-01")]
class User
{
}



use Deprecated\Deprecated;

#[Deprecated()]
class User
{
    #[Deprecated(since: '2024')]
    const USER = '';

    #[Deprecated(since: '2024')]
    private string $name;
    
    #[Deprecated('Use another method instead', 2024)]
    public function method1()
    {
    }
}



use Deprecated\Deprecated;

/**
 * @deprecated
 */
#[Deprecated()]
class User
{
    /**
     * @deprecated
     */
    #[Deprecated(since: '2024')]
    const USER = '';

    /**
     * @deprecated
     */
    #[Deprecated(since: '2024')]
    private string $name;
    
    /**
     * @deprecated
     */
    #[Deprecated('Use another method instead', 2024)]
    public function method1()
    {
    }
}