3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(E_ALL); class DtoException extends Exception { } abstract class Dto { private static $propertyNamesByClass = array(); private function __construct(array $propertiesKeyValues) { foreach($propertiesKeyValues as $propertyName=>$propertyValue) if(Static::hasPropertyName($propertyName)) $this->set($propertyName,$propertyValue); } public function __call($method, array $arguments) { $getOrSet = substr($method, 0, 3); if($getOrSet != 'get' && $getOrSet != 'set') throw new DtoException('"'.get_class($this).'" has no method "'.$method.'"'); $propertyName = strtolower(substr($method, 3)); if(!Static::hasPropertyName($propertyName)) throw new DtoException('"'.get_class($this).'" has no property "'.$propertyName.'"'); $getOrSetMethod = array($this,$getOrSet); array_unshift($arguments,$propertyName); return call_user_func_array($getOrSetMethod, $arguments); } public function __get($propertyName) { if(!Static::hasPropertyName($propertyName)) throw new DtoException('"'.get_class($this).'" has no property "'.$propertyName.'"'); return $this->get($propertyName); } public function __set($propertyName, $propertyValue) { if(!Static::hasPropertyName($propertyName)) throw new DtoException('"'.get_class($this).'" has no property "'.$propertyName.'"'); return $this->set($propertyName, $propertyValue); } public static function createFromArray($propertiesKeyValues) { return new Static($propertiesKeyValues); } public function set($propertyName, $propertyValue) { $this->$propertyName = $propertyValue; } public function get($propertyName) { return $this->$propertyName; } public static function getPropertyNames() { $className = get_called_class(); if(isset(self::$propertyNamesByClass[$className])) return self::$propertyNamesByClass[$className]; $reflected = new ReflectionClass($className); $properties = $reflected->getProperties( ReflectionProperty::IS_PUBLIC ); $propertyNames = array(); foreach($properties as $property) { $propertyNames[] = $property->getName(); } self::$propertyNamesByClass[$className] = $propertyNames; return $propertyNames; } public static function hasPropertyName($propertyName) { $propertyNames = Static::getPropertyNames(); return in_array($propertyName,$propertyNames); } public function asArray() { $values = array(); foreach (Static::getPropertyNames() as $propertyName) { $values[$propertyName] = $this->get($propertyName); } return $values; } public function __sleep() { $propertyNames = self::getPropertyNames(); foreach ($propertyNames as $propertyName) { $propertyValue = $this->get($propertyName); $this->set($propertyName, $propertyValue); } return $propertyNames; } public function __wakeup() { $propertyNames = self::getPropertyNames(); return $propertyNames; } } class Person extends Dto { public $name; public $surname; } class Test { const PERSON_NAME = 'name'; const PERSON_SURNAME = 'surname'; public function testProvideDtoPropertyNames() { $propertyNames = Person::getPropertyNames(); $expectedProperties = array( self::PERSON_NAME, self::PERSON_SURNAME, ); $this->assertEquals( $expectedProperties, $propertyNames ); } public function testProvidePropertyViaGeneralGetter() { $dto = Person::createFromArray(array( self::PERSON_NAME => 'Simone', )); $this->assertEquals( 'Simone', $dto->getName() ); } public function testDTOAcceptOnlyItsOwnProperties() { $dto = Person::createFromArray(array( self::PERSON_NAME => 'Simone', 'non existent property' => 'Simone', )); $expectedProperties = array( self::PERSON_NAME => 'Simone', self::PERSON_SURNAME => null, ); $this->assertEquals( $expectedProperties, $dto->asArray() ); } public function testSerializationKeepSameProperties() { $properties = array( self::PERSON_NAME => 'Simone', self::PERSON_SURNAME => null, ); $dto = Person::createFromArray($properties); $serialized = serialize($dto); $unserialized = unserialize($serialized); $this->assertEquals( $dto->asArray(), $unserialized->asArray() ); $this->assertEquals( $properties, $unserialized->asArray() ); } public function assertEquals($a,$b) { $serializeA = serialize($a); $serializeB = serialize($b); echo ($serializeA==$serializeB?'Pass':'FAIL').' : '.$serializeA.' ; '.$serializeB."\n"; } } $test = new Test(); $test->testProvideDtoPropertyNames(); $test->testProvidePropertyViaGeneralGetter(); $test->testDTOAcceptOnlyItsOwnProperties(); $test->testSerializationKeepSameProperties();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rL8Uf
function name:  (null)
number of ops:  15
compiled vars:  !0 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'error_reporting'
          1        SEND_VAL                                                 32767
          2        DO_ICALL                                                 
  197     3        NEW                                              $2      'Test'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $2
  198     6        INIT_METHOD_CALL                                         !0, 'testProvideDtoPropertyNames'
          7        DO_FCALL                                      0          
  199     8        INIT_METHOD_CALL                                         !0, 'testProvidePropertyViaGeneralGetter'
          9        DO_FCALL                                      0          
  200    10        INIT_METHOD_CALL                                         !0, 'testDTOAcceptOnlyItsOwnProperties'
         11        DO_FCALL                                      0          
  201    12        INIT_METHOD_CALL                                         !0, 'testSerializationKeepSameProperties'
         13        DO_FCALL                                      0          
         14      > RETURN                                                   1

Class DtoException: [no user functions]
Class Dto:
Function __construct:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 13
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 13
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 12
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 12
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
filename:       /in/rL8Uf
function name:  __construct
number of ops:  15
compiled vars:  !0 = $propertiesKeyValues, !1 = $propertyValue, !2 = $propertyName
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
   13     1      > FE_RESET_R                                       $3      !0, ->13
          2    > > FE_FETCH_R                                       ~4      $3, !1, ->13
          3    >   ASSIGN                                                   !2, ~4
   14     4        INIT_STATIC_METHOD_CALL                                  'hasPropertyName'
          5        SEND_VAR_EX                                              !2
          6        DO_FCALL                                      0  $6      
          7      > JMPZ                                                     $6, ->12
   15     8    >   INIT_METHOD_CALL                                         'set'
          9        SEND_VAR_EX                                              !2
         10        SEND_VAR_EX                                              !1
         11        DO_FCALL                                      0          
   13    12    > > JMP                                                      ->2
         13    >   FE_FREE                                                  $3
   16    14      > RETURN                                                   null

End of function __construct

Function __call:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 10, Position 2 = 12
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 23
Branch analysis from position: 13
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 23
2 jumps found. (Code = 43) Position 1 = 36, Position 2 = 46
Branch analysis from position: 36
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 46
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/rL8Uf
function name:  __call
number of ops:  60
compiled vars:  !0 = $method, !1 = $arguments, !2 = $getOrSet, !3 = $propertyName, !4 = $getOrSetMethod
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   19     2        INIT_FCALL                                               'substr'
          3        SEND_VAR                                                 !0
          4        SEND_VAL                                                 0
          5        SEND_VAL                                                 3
          6        DO_ICALL                                         $5      
          7        ASSIGN                                                   !2, $5
   20     8        IS_NOT_EQUAL                                     ~7      !2, 'get'
          9      > JMPZ_EX                                          ~7      ~7, ->12
         10    >   IS_NOT_EQUAL                                     ~8      !2, 'set'
         11        BOOL                                             ~7      ~8
         12    > > JMPZ                                                     ~7, ->23
   21    13    >   NEW                                              $9      'DtoException'
         14        FETCH_THIS                                       ~10     
         15        GET_CLASS                                        ~11     ~10
         16        CONCAT                                           ~12     '%22', ~11
         17        CONCAT                                           ~13     ~12, '%22+has+no+method+%22'
         18        CONCAT                                           ~14     ~13, !0
         19        CONCAT                                           ~15     ~14, '%22'
         20        SEND_VAL_EX                                              ~15
         21        DO_FCALL                                      0          
         22      > THROW                                         0          $9
   23    23    >   INIT_FCALL                                               'strtolower'
         24        INIT_FCALL                                               'substr'
         25        SEND_VAR                                                 !0
         26        SEND_VAL                                                 3
         27        DO_ICALL                                         $17     
         28        SEND_VAR                                                 $17
         29        DO_ICALL                                         $18     
         30        ASSIGN                                                   !3, $18
   24    31        INIT_STATIC_METHOD_CALL                                  'hasPropertyName'
         32        SEND_VAR_EX                                              !3
         33        DO_FCALL                                      0  $20     
         34        BOOL_NOT                                         ~21     $20
         35      > JMPZ                                                     ~21, ->46
   25    36    >   NEW                                              $22     'DtoException'
         37        FETCH_THIS                                       ~23     
         38        GET_CLASS                                        ~24     ~23
         39        CONCAT                                           ~25     '%22', ~24
         40        CONCAT                                           ~26     ~25, '%22+has+no+property+%22'
         41        CONCAT                                           ~27     ~26, !3
         42        CONCAT                                           ~28     ~27, '%22'
         43        SEND_VAL_EX                                              ~28
         44        DO_FCALL                                      0          
         45      > THROW                                         0          $22
   27    46    >   FETCH_THIS                                       ~30     
         47        INIT_ARRAY                                       ~31     ~30
         48        ADD_ARRAY_ELEMENT                                ~31     !2
         49        ASSIGN                                                   !4, ~31
   28    50        INIT_FCALL                                               'array_unshift'
         51        SEND_REF                                                 !1
         52        SEND_VAR                                                 !3
         53        DO_ICALL                                                 
   29    54        INIT_USER_CALL                                0          'call_user_func_array', !4
         55        SEND_ARRAY                                               !1
         56        CHECK_UNDEF_ARGS                                         
         57        DO_FCALL                                      0  $34     
         58      > RETURN                                                   $34
   30    59*     > RETURN                                                   null

End of function __call

Function __get:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 16
Branch analysis from position: 6
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rL8Uf
function name:  __get
number of ops:  21
compiled vars:  !0 = $propertyName
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   31     0  E >   RECV                                             !0      
   33     1        INIT_STATIC_METHOD_CALL                                  'hasPropertyName'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0  $1      
          4        BOOL_NOT                                         ~2      $1
          5      > JMPZ                                                     ~2, ->16
   34     6    >   NEW                                              $3      'DtoException'
          7        FETCH_THIS                                       ~4      
          8        GET_CLASS                                        ~5      ~4
          9        CONCAT                                           ~6      '%22', ~5
         10        CONCAT                                           ~7      ~6, '%22+has+no+property+%22'
         11        CONCAT                                           ~8      ~7, !0
         12        CONCAT                                           ~9      ~8, '%22'
         13        SEND_VAL_EX                                              ~9
         14        DO_FCALL                                      0          
         15      > THROW                                         0          $3
   36    16    >   INIT_METHOD_CALL                                         'get'
         17        SEND_VAR_EX                                              !0
         18        DO_FCALL                                      0  $11     
         19      > RETURN                                                   $11
   37    20*     > RETURN                                                   null

End of function __get

Function __set:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 17
Branch analysis from position: 7
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rL8Uf
function name:  __set
number of ops:  23
compiled vars:  !0 = $propertyName, !1 = $propertyValue
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   38     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   40     2        INIT_STATIC_METHOD_CALL                                  'hasPropertyName'
          3        SEND_VAR_EX                                              !0
          4        DO_FCALL                                      0  $2      
          5        BOOL_NOT                                         ~3      $2
          6      > JMPZ                                                     ~3, ->17
   41     7    >   NEW                                              $4      'DtoException'
          8        FETCH_THIS                                       ~5      
          9        GET_CLASS                                        ~6      ~5
         10        CONCAT                                           ~7      '%22', ~6
         11        CONCAT                                           ~8      ~7, '%22+has+no+property+%22'
         12        CONCAT                                           ~9      ~8, !0
         13        CONCAT                                           ~10     ~9, '%22'
         14        SEND_VAL_EX                                              ~10
         15        DO_FCALL                                      0          
         16      > THROW                                         0          $4
   43    17    >   INIT_METHOD_CALL                                         'set'
         18        SEND_VAR_EX                                              !0
         19        SEND_VAR_EX                                              !1
         20        DO_FCALL                                      0  $12     
         21      > RETURN                                                   $12
   44    22*     > RETURN                                                   null

End of function __set

Function createfromarray:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rL8Uf
function name:  createFromArray
number of ops:  6
compiled vars:  !0 = $propertiesKeyValues
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   46     0  E >   RECV                                             !0      
   48     1        NEW                          static              $1      
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
          4      > RETURN                                                   $1
   49     5*     > RETURN                                                   null

End of function createfromarray

Function set:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rL8Uf
function name:  set
number of ops:  5
compiled vars:  !0 = $propertyName, !1 = $propertyValue
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   51     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   53     2        ASSIGN_OBJ                                               !0
          3        OP_DATA                                                  !1
   54     4      > RETURN                                                   null

End of function set

Function get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rL8Uf
function name:  get
number of ops:  4
compiled vars:  !0 = $propertyName
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   56     0  E >   RECV                                             !0      
   58     1        FETCH_OBJ_R                                      ~1      !0
          2      > RETURN                                                   ~1
   59     3*     > RETURN                                                   null

End of function get

Function getpropertynames:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 8
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
2 jumps found. (Code = 77) Position 1 = 18, Position 2 = 24
Branch analysis from position: 18
2 jumps found. (Code = 78) Position 1 = 19, Position 2 = 24
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
filename:       /in/rL8Uf
function name:  getPropertyNames
number of ops:  30
compiled vars:  !0 = $className, !1 = $reflected, !2 = $properties, !3 = $propertyNames, !4 = $property
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   63     0  E >   GET_CALLED_CLASS                                 ~5      
          1        ASSIGN                                                   !0, ~5
   64     2        FETCH_STATIC_PROP_IS                             ~7      'propertyNamesByClass'
          3        ISSET_ISEMPTY_DIM_OBJ                         0          ~7, !0
          4      > JMPZ                                                     ~8, ->8
   65     5    >   FETCH_STATIC_PROP_R          unknown             ~9      'propertyNamesByClass'
          6        FETCH_DIM_R                                      ~10     ~9, !0
          7      > RETURN                                                   ~10
   67     8    >   NEW                                              $11     'ReflectionClass'
          9        SEND_VAR_EX                                              !0
         10        DO_FCALL                                      0          
         11        ASSIGN                                                   !1, $11
   68    12        INIT_METHOD_CALL                                         !1, 'getProperties'
   69    13        SEND_VAL_EX                                              1
         14        DO_FCALL                                      0  $14     
   68    15        ASSIGN                                                   !2, $14
   72    16        ASSIGN                                                   !3, <array>
   73    17      > FE_RESET_R                                       $17     !2, ->24
         18    > > FE_FETCH_R                                               $17, !4, ->24
   74    19    >   INIT_METHOD_CALL                                         !4, 'getName'
         20        DO_FCALL                                      0  $19     
         21        ASSIGN_DIM                                               !3
         22        OP_DATA                                                  $19
   73    23      > JMP                                                      ->18
         24    >   FE_FREE                                                  $17
   77    25        FETCH_STATIC_PROP_W          unknown             $20     'propertyNamesByClass'
         26        ASSIGN_DIM                                               $20, !0
         27        OP_DATA                                                  !3
   78    28      > RETURN                                                   !3
   79    29*     > RETURN                                                   null

End of function getpropertynames

Function haspropertyname:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rL8Uf
function name:  hasPropertyName
number of ops:  10
compiled vars:  !0 = $propertyName, !1 = $propertyNames
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   80     0  E >   RECV                                             !0      
   82     1        INIT_STATIC_METHOD_CALL                                  'getPropertyNames'
          2        DO_FCALL                                      0  $2      
          3        ASSIGN                                                   !1, $2
   83     4        INIT_FCALL                                               'in_array'
          5        SEND_VAR                                                 !0
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                         $4      
          8      > RETURN                                                   $4
   84     9*     > RETURN                                                   null

End of function haspropertyname

Function asarray:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 11
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 11
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
filename:       /in/rL8Uf
function name:  asArray
number of ops:  14
compiled vars:  !0 = $values, !1 = $propertyName
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   88     0  E >   ASSIGN                                                   !0, <array>
   90     1        INIT_STATIC_METHOD_CALL                                  'getPropertyNames'
          2        DO_FCALL                                      0  $3      
          3      > FE_RESET_R                                       $4      $3, ->11
          4    > > FE_FETCH_R                                               $4, !1, ->11
   91     5    >   INIT_METHOD_CALL                                         'get'
          6        SEND_VAR_EX                                              !1
          7        DO_FCALL                                      0  $6      
          8        ASSIGN_DIM                                               !0, !1
          9        OP_DATA                                                  $6
   90    10      > JMP                                                      ->4
         11    >   FE_FREE                                                  $4
   94    12      > RETURN                                                   !0
   95    13*     > RETURN                                                   null

End of function asarray

Function __sleep:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 14
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 14
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
filename:       /in/rL8Uf
function name:  __sleep
number of ops:  17
compiled vars:  !0 = $propertyNames, !1 = $propertyName, !2 = $propertyValue
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   99     0  E >   INIT_STATIC_METHOD_CALL                                  'getPropertyNames'
          1        DO_FCALL                                      0  $3      
          2        ASSIGN                                                   !0, $3
  101     3      > FE_RESET_R                                       $5      !0, ->14
          4    > > FE_FETCH_R                                               $5, !1, ->14
  102     5    >   INIT_METHOD_CALL                                         'get'
          6        SEND_VAR_EX                                              !1
          7        DO_FCALL                                      0  $6      
          8        ASSIGN                                                   !2, $6
  103     9        INIT_METHOD_CALL                                         'set'
         10        SEND_VAR_EX                                              !1
         11        SEND_VAR_EX                                              !2
         12        DO_FCALL                                      0          
  101    13      > JMP                                                      ->4
         14    >   FE_FREE                                                  $5
  106    15      > RETURN                                                   !0
  107    16*     > RETURN                                                   null

End of function __sleep

Function __wakeup:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rL8Uf
function name:  __wakeup
number of ops:  5
compiled vars:  !0 = $propertyNames
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  111     0  E >   INIT_STATIC_METHOD_CALL                                  'getPropertyNames'
          1        DO_FCALL                                      0  $1      
          2        ASSIGN                                                   !0, $1
  113     3      > RETURN                                                   !0
  114     4*     > RETURN                                                   null

End of function __wakeup

End of class Dto.

Class Person:
Function __construct:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 13
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 13
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 12
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 12
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
filename:       /in/rL8Uf
function name:  __construct
number of ops:  15
compiled vars:  !0 = $propertiesKeyValues, !1 = $propertyValue, !2 = $propertyName
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
   13     1      > FE_RESET_R                                       $3      !0, ->13
          2    > > FE_FETCH_R                                       ~4      $3, !1, ->13
          3    >   ASSIGN                                                   !2, ~4
   14     4        INIT_STATIC_METHOD_CALL                                  'hasPropertyName'
          5        SEND_VAR_EX                                              !2
          6        DO_FCALL                                      0  $6      
          7      > JMPZ                                                     $6, ->12
   15     8    >   INIT_METHOD_CALL                                         'set'
          9        SEND_VAR_EX                                              !2
         10        SEND_VAR_EX                                              !1
         11        DO_FCALL                                      0          
   13    12    > > JMP                                                      ->2
         13    >   FE_FREE                                                  $3
   16    14      > RETURN                                                   null

End of function __construct

Function __call:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 10, Position 2 = 12
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 23
Branch analysis from position: 13
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 23
2 jumps found. (Code = 43) Position 1 = 36, Position 2 = 46
Branch analysis from position: 36
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 46
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/rL8Uf
function name:  __call
number of ops:  60
compiled vars:  !0 = $method, !1 = $arguments, !2 = $getOrSet, !3 = $propertyName, !4 = $getOrSetMethod
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   19     2        INIT_FCALL                                               'substr'
          3        SEND_VAR                                                 !0
          4        SEND_VAL                                                 0
          5        SEND_VAL                                                 3
          6        DO_ICALL                                         $5      
          7        ASSIGN                                                   !2, $5
   20     8        IS_NOT_EQUAL                                     ~7      !2, 'get'
          9      > JMPZ_EX                                          ~7      ~7, ->12
         10    >   IS_NOT_EQUAL                                     ~8      !2, 'set'
         11        BOOL                                             ~7      ~8
         12    > > JMPZ                                                     ~7, ->23
   21    13    >   NEW                                              $9      'DtoException'
         14        FETCH_THIS                                       ~10     
         15        GET_CLASS                                        ~11     ~10
         16        CONCAT                                           ~12     '%22', ~11
         17        CONCAT                                           ~13     ~12, '%22+has+no+method+%22'
         18        CONCAT                                           ~14     ~13, !0
         19        CONCAT                                           ~15     ~14, '%22'
         20        SEND_VAL_EX                                              ~15
         21        DO_FCALL                                      0          
         22      > THROW                                         0          $9
   23    23    >   INIT_FCALL                                               'strtolower'
         24        INIT_FCALL                                               'substr'
         25        SEND_VAR                                                 !0
         26        SEND_VAL                                                 3
         27        DO_ICALL                                         $17     
         28        SEND_VAR                                                 $17
         29        DO_ICALL                                         $18     
         30        ASSIGN                                                   !3, $18
   24    31        INIT_STATIC_METHOD_CALL                                  'hasPropertyName'
         32        SEND_VAR_EX                                              !3
         33        DO_FCALL                                      0  $20     
         34        BOOL_NOT                                         ~21     $20
         35   

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.51 ms | 1428 KiB | 23 Q