3v4l.org

run code in 300+ PHP versions simultaneously
<?php class OpenStruct extends ArrayObject { public function __construct($input = array()) { parent::__construct($input, static::ARRAY_AS_PROPS); } public function offsetSet($key, $value) { if (is_array($value)) { parent::offsetSet($key, new static($value)); } else { parent::offsetSet($key, $value); } } public function offsetGet($key) { $raw = parent::offsetGet($key); if (is_callable($raw)) { return call_user_func($raw); } return $raw; } public function __call($method, $args) { $raw = parent::offsetGet($method); if (is_callable($raw)) { if (version_compare(PHP_VERSION, '5.4.0', '>=') && $raw instanceof \Closure) { $raw->bindTo($this); } return call_user_func_array($raw, $args); } } static public function fromJson($json) { if (! is_string($json)) { throw new InvalidArgumentException('Argument must be a string.'); } $input = json_decode($json, true); if (null === $input) { throw new InvalidArgumentException('Argument must be a string containing valid JSON.'); } return new static($input); } } class Struct extends OpenStruct { public function __construct($input) { parent::__construct($input); } public function offsetSet($key, $value) { if (! $this->offsetExists($key)) { throw new RuntimeException(sprintf('Undefined field "%s"', $key)); } parent::offsetSet($key, $value); } public function offsetGet($key) { if (! $this->offsetExists($key)) { throw new RuntimeException(sprintf('Undefined field "%s"', $key)); } parent::offsetGet($key); } public function offsetUnset($key) { throw new RuntimeException(sprintf('Cannot unset field "%s"', $key)); } } // OpenStruct with Constructor Parameters // Cannot Change Structure $person = new OpenStruct(array('first' => 'Joe', 'last' => 'Bloggs', 'age' => 20)); // Nested Array becomes OpenStruct $person->address = array( 'address' => '123 Alphabet Street', 'city' => 'Awesome City', 'postcode' => 'ABC 123', 'country' => 'Awesome Country' ); $person->first; // $person['first']; $person->last; // $person['last']; $person->age; // $person['age']; $person->address->city; // $person['address']['city']; // Nested OpenStruct $person->hobbies = new OpenStruct(array('Football', 'Ice Hockey', 'Formula 1')); // Traversable foreach ($person->hobbies as $hobby) { echo 'Hobby: ' . $hobby . "\n"; } // Convert to JSON echo 'JSON: ' . $person->toJson() . "\n"; print_r($person); // OpenStruct with no Constructor $person = new OpenStruct; $person->name = 'Joe'; $person['name'] = 'John'; print_r($person); // Struct Requires Constructor Parameters // Cannot Change Structure try { $person = new Struct(array('first' => 'Joe', 'last' => 'Bloggs', 'hobbies' => array('Football', 'Ice Hockey', 'Formula 1'))); print_r($person); $person->age = 30; } catch (RuntimeException $e) { echo 'Cannot change Struct' . "\n"; } // OpenStruct from JSON String // Can Change Structure $json = OpenStruct::fromJson('{"first":"Joe","last":"Bloggs","age":20,"address":{"address":"123 Alphabet Street","city":"Awesome City","postcode":"ABC 123","country":"Canada"}}'); $json->foo = 'bar'; print_r($json); // Struct from JSON String // Cannot Change Structure try { $json = Struct::fromJson('{"first":"Joe","last":"Bloggs","age":20,"address":{"address":"123 Alphabet Street","city":"Awesome City","postcode":"ABC 123","country":"Canada"}}'); print_r($json); $json->foo = 'bar'; } catch (RuntimeException $e) { echo 'Cannot change Struct' . "\n"; } // OpenStructs with Closures $open = new OpenStruct; $open->first = 'Joe'; $open->last = 'Bloggs'; $open->fullName = function() use ($open) { return $open->first . ' ' . $open->last; }; /* // PHP 5.4 Style $open->fullName = function() { return $this->first . ' ' . $this->last; }; */ $open->last = 'Smith'; print_r($open->fullName()); // OpenStruct from Object $object = new StdClass; $object->first = 'Joe'; $object->last = 'Bloggs'; $open = new OpenStruct($object); $open->first; print_r($open); // Struct from Object $object = new StdClass; $object->first = 'Joe'; $object->last = 'Bloggs'; try { $open = new Struct($object); print_r($open); $open->age = 30; } catch (RuntimeException $e) { echo 'Cannot change Struct' . "\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 22, Position 2 = 27
Branch analysis from position: 22
2 jumps found. (Code = 78) Position 1 = 23, Position 2 = 27
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 58
Branch analysis from position: 58
1 jumps found. (Code = 42) Position 1 = 79
Branch analysis from position: 79
1 jumps found. (Code = 42) Position 1 = 132
Branch analysis from position: 132
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
Found catch point at position: 56
Branch analysis from position: 56
2 jumps found. (Code = 107) Position 1 = 57, Position 2 = -2
Branch analysis from position: 57
1 jumps found. (Code = 42) Position 1 = 79
Branch analysis from position: 79
Found catch point at position: 77
Branch analysis from position: 77
2 jumps found. (Code = 107) Position 1 = 78, Position 2 = -2
Branch analysis from position: 78
1 jumps found. (Code = 42) Position 1 = 132
Branch analysis from position: 132
Found catch point at position: 130
Branch analysis from position: 130
2 jumps found. (Code = 107) Position 1 = 131, Position 2 = -2
Branch analysis from position: 131
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hFIGn
function name:  (null)
number of ops:  133
compiled vars:  !0 = $person, !1 = $hobby, !2 = $e, !3 = $json, !4 = $open, !5 = $object
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   88     0  E >   NEW                                              $6      'OpenStruct'
          1        SEND_VAL_EX                                              <array>
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $6
   91     4        ASSIGN_OBJ                                               !0, 'address'
   92     5        OP_DATA                                                  <array>
   98     6        FETCH_OBJ_R                                      ~10     !0, 'first'
          7        FREE                                                     ~10
   99     8        FETCH_OBJ_R                                      ~11     !0, 'last'
          9        FREE                                                     ~11
  100    10        FETCH_OBJ_R                                      ~12     !0, 'age'
         11        FREE                                                     ~12
  101    12        FETCH_OBJ_R                                      ~13     !0, 'address'
         13        FETCH_OBJ_R                                      ~14     ~13, 'city'
         14        FREE                                                     ~14
  104    15        NEW                                              $16     'OpenStruct'
         16        SEND_VAL_EX                                              <array>
         17        DO_FCALL                                      0          
         18        ASSIGN_OBJ                                               !0, 'hobbies'
         19        OP_DATA                                                  $16
  107    20        FETCH_OBJ_R                                      ~18     !0, 'hobbies'
         21      > FE_RESET_R                                       $19     ~18, ->27
         22    > > FE_FETCH_R                                               $19, !1, ->27
  108    23    >   CONCAT                                           ~20     'Hobby%3A+', !1
         24        CONCAT                                           ~21     ~20, '%0A'
         25        ECHO                                                     ~21
  107    26      > JMP                                                      ->22
         27    >   FE_FREE                                                  $19
  112    28        INIT_METHOD_CALL                                         !0, 'toJson'
         29        DO_FCALL                                      0  $22     
         30        CONCAT                                           ~23     'JSON%3A+', $22
         31        CONCAT                                           ~24     ~23, '%0A'
         32        ECHO                                                     ~24
  113    33        INIT_FCALL                                               'print_r'
         34        SEND_VAR                                                 !0
         35        DO_ICALL                                                 
  116    36        NEW                                              $26     'OpenStruct'
         37        DO_FCALL                                      0          
         38        ASSIGN                                                   !0, $26
  117    39        ASSIGN_OBJ                                               !0, 'name'
         40        OP_DATA                                                  'Joe'
  118    41        ASSIGN_DIM                                               !0, 'name'
         42        OP_DATA                                                  'John'
  119    43        INIT_FCALL                                               'print_r'
         44        SEND_VAR                                                 !0
         45        DO_ICALL                                                 
  124    46        NEW                                              $32     'Struct'
         47        SEND_VAL_EX                                              <array>
         48        DO_FCALL                                      0          
         49        ASSIGN                                                   !0, $32
  125    50        INIT_FCALL                                               'print_r'
         51        SEND_VAR                                                 !0
         52        DO_ICALL                                                 
  126    53        ASSIGN_OBJ                                               !0, 'age'
         54        OP_DATA                                                  30
         55      > JMP                                                      ->58
  127    56  E > > CATCH                                       last         'RuntimeException'
  128    57    >   ECHO                                                     'Cannot+change+Struct%0A'
  133    58    >   INIT_STATIC_METHOD_CALL                                  'OpenStruct', 'fromJson'
         59        SEND_VAL                                                 '%7B%22first%22%3A%22Joe%22%2C%22last%22%3A%22Bloggs%22%2C%22age%22%3A20%2C%22address%22%3A%7B%22address%22%3A%22123+Alphabet+Street%22%2C%22city%22%3A%22Awesome+City%22%2C%22postcode%22%3A%22ABC+123%22%2C%22country%22%3A%22Canada%22%7D%7D'
         60        DO_FCALL                                      0  $37     
         61        ASSIGN                                                   !3, $37
  134    62        ASSIGN_OBJ                                               !3, 'foo'
         63        OP_DATA                                                  'bar'
  135    64        INIT_FCALL                                               'print_r'
         65        SEND_VAR                                                 !3
         66        DO_ICALL                                                 
  140    67        INIT_STATIC_METHOD_CALL                                  'Struct', 'fromJson'
         68        SEND_VAL                                                 '%7B%22first%22%3A%22Joe%22%2C%22last%22%3A%22Bloggs%22%2C%22age%22%3A20%2C%22address%22%3A%7B%22address%22%3A%22123+Alphabet+Street%22%2C%22city%22%3A%22Awesome+City%22%2C%22postcode%22%3A%22ABC+123%22%2C%22country%22%3A%22Canada%22%7D%7D'
         69        DO_FCALL                                      0  $41     
         70        ASSIGN                                                   !3, $41
  141    71        INIT_FCALL                                               'print_r'
         72        SEND_VAR                                                 !3
         73        DO_ICALL                                                 
  142    74        ASSIGN_OBJ                                               !3, 'foo'
         75        OP_DATA                                                  'bar'
         76      > JMP                                                      ->79
  143    77  E > > CATCH                                       last         'RuntimeException'
  144    78    >   ECHO                                                     'Cannot+change+Struct%0A'
  148    79    >   NEW                                              $45     'OpenStruct'
         80        DO_FCALL                                      0          
         81        ASSIGN                                                   !4, $45
  149    82        ASSIGN_OBJ                                               !4, 'first'
         83        OP_DATA                                                  'Joe'
  150    84        ASSIGN_OBJ                                               !4, 'last'
         85        OP_DATA                                                  'Bloggs'
  152    86        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FhFIGn%3A152%240'
         87        BIND_LEXICAL                                             ~51, !4
         88        ASSIGN_OBJ                                               !4, 'fullName'
  154    89        OP_DATA                                                  ~51
  163    90        ASSIGN_OBJ                                               !4, 'last'
         91        OP_DATA                                                  'Smith'
  164    92        INIT_FCALL                                               'print_r'
         93        INIT_METHOD_CALL                                         !4, 'fullName'
         94        DO_FCALL                                      0  $53     
         95        SEND_VAR                                                 $53
         96        DO_ICALL                                                 
  167    97        NEW                                              $55     'StdClass'
         98        DO_FCALL                                      0          
         99        ASSIGN                                                   !5, $55
  168   100        ASSIGN_OBJ                                               !5, 'first'
        101        OP_DATA                                                  'Joe'
  169   102        ASSIGN_OBJ                                               !5, 'last'
        103        OP_DATA                                                  'Bloggs'
  171   104        NEW                                              $60     'OpenStruct'
        105        SEND_VAR_EX                                              !5
        106        DO_FCALL                                      0          
        107        ASSIGN                                                   !4, $60
  172   108        FETCH_OBJ_R                                      ~63     !4, 'first'
        109        FREE                                                     ~63
  173   110        INIT_FCALL                                               'print_r'
        111        SEND_VAR                                                 !4
        112        DO_ICALL                                                 
  176   113        NEW                                              $65     'StdClass'
        114        DO_FCALL                                      0          
        115        ASSIGN                                                   !5, $65
  177   116        ASSIGN_OBJ                                               !5, 'first'
        117        OP_DATA                                                  'Joe'
  178   118        ASSIGN_OBJ                                               !5, 'last'
        119        OP_DATA                                                  'Bloggs'
  181   120        NEW                                              $70     'Struct'
        121        SEND_VAR_EX                                              !5
        122        DO_FCALL                                      0          
        123        ASSIGN                                                   !4, $70
  182   124        INIT_FCALL                                               'print_r'
        125        SEND_VAR                                                 !4
        126        DO_ICALL                                                 
  183   127        ASSIGN_OBJ                                               !4, 'age'
        128        OP_DATA                                                  30
        129      > JMP                                                      ->132
  184   130  E > > CATCH                                       last         'RuntimeException'
  185   131    >   ECHO                                                     'Cannot+change+Struct%0A'
  186   132    > > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FhFIGn%3A152%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hFIGn
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $open
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  152     0  E >   BIND_STATIC                                              !0
  153     1        FETCH_OBJ_R                                      ~1      !0, 'first'
          2        CONCAT                                           ~2      ~1, '+'
          3        FETCH_OBJ_R                                      ~3      !0, 'last'
          4        CONCAT                                           ~4      ~2, ~3
          5      > RETURN                                                   ~4
  154     6*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FhFIGn%3A152%240

Class OpenStruct:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hFIGn
function name:  __construct
number of ops:  7
compiled vars:  !0 = $input
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV_INIT                                        !0      <array>
    6     1        INIT_STATIC_METHOD_CALL                                  
          2        SEND_VAR_EX                                              !0
          3        FETCH_CLASS_CONSTANT                             ~1      'ARRAY_AS_PROPS'
          4        SEND_VAL_EX                                              ~1
          5        DO_FCALL                                      0          
    7     6      > RETURN                                                   null

End of function __construct

Function offsetset:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 12
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hFIGn
function name:  offsetSet
number of ops:  17
compiled vars:  !0 = $key, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   11     2        TYPE_CHECK                                  128          !1
          3      > JMPZ                                                     ~2, ->12
   12     4    >   INIT_STATIC_METHOD_CALL                                  'offsetSet'
          5        SEND_VAR_EX                                              !0
          6        NEW                          static              $3      
          7        SEND_VAR_EX                                              !1
          8        DO_FCALL                                      0          
          9        SEND_VAR_NO_REF_EX                                       $3
         10        DO_FCALL                                      0          
         11      > JMP                                                      ->16
   14    12    >   INIT_STATIC_METHOD_CALL                                  'offsetSet'
         13        SEND_VAR_EX                                              !0
         14        SEND_VAR_EX                                              !1
         15        DO_FCALL                                      0          
   16    16    > > RETURN                                                   null

End of function offsetset

Function offsetget:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 12
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hFIGn
function name:  offsetGet
number of ops:  14
compiled vars:  !0 = $key, !1 = $raw
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   RECV                                             !0      
   20     1        INIT_STATIC_METHOD_CALL                                  'offsetGet'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0  $2      
          4        ASSIGN                                                   !1, $2
   21     5        INIT_FCALL                                               'is_callable'
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                         $4      
          8      > JMPZ                                                     $4, ->12
   22     9    >   INIT_USER_CALL                                0          'call_user_func', !1
         10        DO_FCALL                                      0  $5      
         11      > RETURN                                                   $5
   25    12    > > RETURN                                                   !1
   26    13*     > RETURN                                                   null

End of function offsetget

Function __call:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 28
Branch analysis from position: 10
2 jumps found. (Code = 46) Position 1 = 16, Position 2 = 18
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 23
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
Branch analysis from position: 18
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hFIGn
function name:  __call
number of ops:  29
compiled vars:  !0 = $method, !1 = $args, !2 = $raw
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   28     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   30     2        INIT_STATIC_METHOD_CALL                                  'offsetGet'
          3        SEND_VAR_EX                                              !0
          4        DO_FCALL                                      0  $3      
          5        ASSIGN                                                   !2, $3
   31     6        INIT_FCALL                                               'is_callable'
          7        SEND_VAR                                                 !2
          8        DO_ICALL                                         $5      
          9      > JMPZ                                                     $5, ->28
   32    10    >   INIT_FCALL                                               'version_compare'
         11        SEND_VAL                                                 '8.0.0'
         12        SEND_VAL                                                 '5.4.0'
         13        SEND_VAL                                                 '%3E%3D'
         14        DO_ICALL                                         $6      
         15      > JMPZ_EX                                          ~7      $6, ->18
         16    >   INSTANCEOF                                       ~8      !2, 'Closure'
         17        BOOL                                             ~7      ~8
         18    > > JMPZ                                                     ~7, ->23
   33    19    >   INIT_METHOD_CALL                                         !2, 'bindTo'
         20        FETCH_THIS                                       $9      
         21        SEND_VAR_EX                                              $9
         22        DO_FCALL                                      0          
   36    23    >   INIT_USER_CALL                                0          'call_user_func_array', !2
         24        SEND_ARRAY                                               !1
         25        CHECK_UNDEF_ARGS                                         
         26        DO_FCALL                                      0  $11     
         27      > RETURN                                                   $11
   38    28    > > RETURN                                                   null

End of function __call

Function fromjson:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 8
Branch analysis from position: 4
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 19
Branch analysis from position: 15
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hFIGn
function name:  fromJson
number of ops:  24
compiled vars:  !0 = $json, !1 = $input
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   40     0  E >   RECV                                             !0      
   42     1        TYPE_CHECK                                   64  ~2      !0
          2        BOOL_NOT                                         ~3      ~2
          3      > JMPZ                                                     ~3, ->8
   43     4    >   NEW                                              $4      'InvalidArgumentException'
          5        SEND_VAL_EX                                              'Argument+must+be+a+string.'
          6        DO_FCALL                                      0          
          7      > THROW                                         0          $4
   46     8    >   INIT_FCALL                                               'json_decode'
          9        SEND_VAR                                                 !0
         10        SEND_VAL                                                 <true>
         11        DO_ICALL                                         $6      
         12        ASSIGN                                                   !1, $6
   47    13        TYPE_CHECK                                    2          !1
         14      > JMPZ                                                     ~8, ->19
   48    15    >   NEW                                              $9      'InvalidArgumentException'
         16        SEND_VAL_EX                                              'Argument+must+be+a+string+containing+valid+JSON.'
         17        DO_FCALL                                      0          
         18      > THROW                                         0          $9
   51    19    >   NEW                          static              $11     
         20        SEND_VAR_EX                                              !1
         21        DO_FCALL                                      0          
         22      > RETURN                                                   $11
   52    23*     > RETURN                                                   null

End of function fromjson

End of class OpenStruct.

Class Struct:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hFIGn
function name:  __construct
number of ops:  5
compiled vars:  !0 = $input
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   57     0  E >   RECV                                             !0      
   59     1        INIT_STATIC_METHOD_CALL                                  
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
   60     4      > RETURN                                                   null

End of function __construct

Function offsetset:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 15
Branch analysis from position: 7
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hFIGn
function name:  offsetSet
number of ops:  20
compiled vars:  !0 = $key, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   62     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   64     2        INIT_METHOD_CALL                                         'offsetExists'
          3        SEND_VAR_EX                                              !0
          4        DO_FCALL                                      0  $2      
          5        BOOL_NOT                                         ~3      $2
          6      > JMPZ                                                     ~3, ->15
   65     7    >   NEW                                              $4      'RuntimeException'
          8        INIT_FCALL                                               'sprintf'
          9        SEND_VAL                                                 'Undefined+field+%22%25s%22'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                         $5      
         12        SEND_VAR_NO_REF_EX                                       $5
         13        DO_FCALL                                      0          
         14      > THROW                                         0          $4
   68    15    >   INIT_STATIC_METHOD_CALL                                  'offsetSet'
         16        SEND_VAR_EX                                              !0
         17        SEND_VAR_EX                                              !1
         18        DO_FCALL                                      0          
   69    19      > RETURN                                                   null

End of function offsetset

Function offsetget:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 14
Branch analysis from position: 6
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hFIGn
function name:  offsetGet
number of ops:  18
compiled vars:  !0 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   71     0  E >   RECV                                             !0      
   73     1        INIT_METHOD_CALL                                         'offsetExists'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0  $1      
          4        BOOL_NOT                                         ~2      $1
          5      > JMPZ                                                     ~2, ->14
   74     6    >   NEW                                              $3      'RuntimeException'
          7        INIT_FCALL                                               'sprintf'
          8        SEND_VAL                                                 'Undefined+field+%22%25s%22'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                         $4      
         11        SEND_VAR_NO_REF_EX                                       $4
         12        DO_FCALL                                      0          
         13      > THROW                                         0          $3
   77    14    >   INIT_STATIC_METHOD_CALL                                  'offsetGet'
         15        SEND_VAR_EX                                              !0
         16        DO_FCALL                                      0          
   78    17      > RETURN                                                   null

End of function offsetget

Function offsetunset:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/hFIGn
function name:  offsetUnset
number of ops:  10
compiled vars:  !0 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   80     0  E >   RECV                                             !0      
   82     1        NEW                                              $1      'RuntimeException'
          2        INIT_FCALL                                               'sprintf'
          3        SEND_VAL                                                 'Cannot+unset+field+%22%25s%22'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $2      
          6        SEND_VAR_NO_REF_EX                                       $2
          7        DO_FCALL                                      0          
          8      > THROW                                         0          $1
   83     9*     > RETURN                                                   null

End of function offsetunset

Function __call:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 28
Branch analysis from position: 10
2 jumps found. (Code = 46) Position 1 = 16, Position 2 = 18
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 23
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
Branch analysis from position: 18
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hFIGn
function name:  __call
number of ops:  29
compiled vars:  !0 = $method, !1 = $args, !2 = $raw
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   28     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   30     2        INIT_STATIC_METHOD_CALL                                  'offsetGet'
          3        SEND_VAR_EX                                   

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.3 ms | 1428 KiB | 23 Q