PHP code example of phptdgram / schema

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

    

phptdgram / schema example snippets




use PHPTdGram\Schema\TdSchemaRegistry;

$input = [
    '@type' => 'updateOption',
    'name' => 'version',
    'value' => [
        '@type' => 'optionValueString',
        'value' => '1.6.0',
    ],
];

TdSchemaRegistry::fromArray($input);

class PHPTdGram\Schema\UpdateOption#3 (3) {
  protected string $name =>
  string(7) "version"
  protected PHPTdGram\Schema\OptionValue $value =>
  class PHPTdGram\Schema\OptionValueString#2 (2) {
    protected string $value =>
    string(5) "1.6.0"
    public ?string $tdExtra =>
    NULL
  }
  public ?string $tdExtra =>
  NULL
}



use PHPTdGram\Schema\TdSchemaRegistry;

$input = [
    '@extra' => 'foo',
    '@type' => 'updateAuthorizationState',
    'authorization_state' => [
        '@type' => 'authorizationStateWaitTdlibParameters',
    ],
];

TdSchemaRegistry::fromArray($input);

class PHPTdGram\Schema\UpdateAuthorizationState#3 (2) {
  protected PHPTdGram\Schema\AuthorizationState $authorizationState =>
  class PHPTdGram\Schema\AuthorizationStateWaitTdlibParameters#2 (1) {
    public ?string $tdExtra =>
    NULL
  }
  public ?string $tdExtra =>
  string(3) "foo"
}