PHP code example of php-platform / annotations

1. Go to this page and download the library: Download php-platform/annotations 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/ */

    

php-platform / annotations example snippets


/**
 * @key1
 *  @key2
 * @key3.subKey1
 * @key3.subKey2.subkey21 success
 * @key4 v1
 * @key5 (v2)
 * @key6 v3 v4
 * @key7 "v5\"With Space and Quotes\""
 * @key8 ("v6\"With Space and Quotes\"", v7) 
 * @key9 ("v8\"With Space and Quotes\"", v9) description1
 * @key10 ("v10 With \\", v11) description2
 * @key11 ("123", v12) description3
 * @key12 ("true", "false")
 * @key13 v13
 * @key13 1234
 * @key14 (v14)
 * @key14 v15
 * @ notKey
 * @wrongKey(v16) desc
 *  
 */
public $testDifferrentFormatsOfAnnoptations;

PhpPlatform\Annotations\Annotation::getAnnotations($className, 'testDifferrentFormatsOfAnnoptations');

[
    "testDifferrentFormatsOfAnnoptations" => [
	    "key1" => true,
	    "key2" => true,
	    "key3" => [
	        "subKey1" => true,
	        "subKey2" => [
	            "subkey21" => "success"
	        ]
	    ],
	    "key4" => "v1",
	    "key5" => ["v2"],
	    "key6" => ["v3", "v4"],
	    "key7" => 'v5"With Space and Quotes"',
	    "key8" => ['v6"With Space and Quotes"', "v7"],
	    "key9" => ['v8"With Space and Quotes"', "v9"],
	    "key10" => ["v10 With \\", "v11"],
	    "key11" => [123, "v12"],
	    "key12" => [true, false],
	    "key13" => ['v13', 1234],
	    "key14" => ["v14", "v15"]
	]
]