3v4l.org

run code in 300+ PHP versions simultaneously
<?php try { $user_data = json_encode( [ 'id' => 'a2aa06d9-b3b6-4f8c-a450-a5a37f401ff4', 'name' => 42, 'username' => (float)'NaN', 'email' => true, 'address' => [ 'street' => false, 'suite' => M_PI, 'city' => 1.5, 'zipcode' => 'The back of beyond', 'geo' => [ 'lat' => 'https://3v4l.org', 'lng' => 'looooong', ], ], 'phone' => 'E.T. Phone Home', 'website' => 0, 'company' => [ 'name' => 1.5, 'catchPhrase' => false, 'bs' => true, ], ], JSON_PRETTY_PRINT ); echo $user_data . PHP_EOL; $user_data = json_decode( $user_data, true ); $user = new User_DTO($user_data); $user_list = new User_List_DTO([ 'id' => 2, 'name' => 'Bar', 'username' => 'bar', ]); echo $user->get_id() . PHP_EOL; echo $user->get_name() . PHP_EOL; echo $user->get_username() . PHP_EOL; echo $user_list->get_id() . PHP_EOL; echo $user_list->get_name() . PHP_EOL; echo $user_list->get_username() . PHP_EOL; } catch(Exception $e) { echo $e->getMessage(); } abstract class DTO { protected $data = []; protected $schema = []; public function __construct( array $data ) { $this->validate_data_against_schema( $data, $this->schema ); $this->data = $data; } private function validate_data_against_schema( array $data, array $schema ) { foreach ( $schema as $key => $value ) { if ( ! array_key_exists( $key, $data ) ) { throw new \UnexpectedValueException( sprintf( 'Required key "%s" does not exist.', $key ) ); } // We don't want to enforce any specific type, but if we // expect a scalar, we don't want an array. if ( is_scalar( $value ) && ! is_scalar( $data[ $key ] ) ) { throw new \UnexpectedValueException( sprintf( 'Key "%s" must be scalar, %s provided.', $key, gettype( $data[ $key ] ) ) ); } // Same the other way around. If we expect an array, // we don't want anything else. if ( is_array( $value ) && ! is_array( $data[ $key ] ) ) { throw new \UnexpectedValueException( sprintf( 'Key "%s" must be an array, %s provided.', $key, gettype( $data[ $key ] ) ) ); } // Traverse down the children, recursively. if ( is_array( $value ) ) { $this->validate_data_against_schema( $data[ $key ], $value ); } } } } class User_DTO extends DTO { protected $schema = [ 'id' => '', 'name' => '', 'username' => '', 'email' => '', 'address' => [ 'street' => '', 'suite' => '', 'city' => '', 'zipcode' => '', 'geo' => [ 'lat' => '', 'lng' => '', ], ], 'phone' => '', 'website' => '', 'company' => [ 'name' => '', 'catchPhrase' => '', 'bs' => '', ], ]; public function get_id(): string { return (string) $this->data['id']; } public function get_name(): string { return (string) $this->data['name']; } public function get_username(): string { return (string) $this->data['username']; } // etc } class User_List_DTO extends DTO { protected $schema = [ 'id' => '', 'name' => '', 'username' => '', ]; public function get_id(): string { return (string) $this->data['id']; } public function get_name(): string { return (string) $this->data['name']; } public function get_username(): string { return (string) $this->data['username']; } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 58
Branch analysis from position: 58
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 54
Branch analysis from position: 54
2 jumps found. (Code = 107) Position 1 = 55, Position 2 = -2
Branch analysis from position: 55
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cXIQ2
function name:  (null)
number of ops:  59
compiled vars:  !0 = $user_data, !1 = $user, !2 = $user_list, !3 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INIT_FCALL                                               'json_encode'
    5     1        INIT_ARRAY                                       ~4      'a2aa06d9-b3b6-4f8c-a450-a5a37f401ff4', 'id'
    6     2        ADD_ARRAY_ELEMENT                                ~4      42, 'name'
    7     3        CAST                                          5  ~5      'NaN'
          4        ADD_ARRAY_ELEMENT                                ~4      ~5, 'username'
    5     5        ADD_ARRAY_ELEMENT                                ~4      <true>, 'email'
          6        ADD_ARRAY_ELEMENT                                ~4      <array>, 'address'
   19     7        ADD_ARRAY_ELEMENT                                ~4      'E.T.+Phone+Home', 'phone'
   20     8        ADD_ARRAY_ELEMENT                                ~4      0, 'website'
    5     9        ADD_ARRAY_ELEMENT                                ~4      <array>, 'company'
         10        SEND_VAL                                                 ~4
   26    11        SEND_VAL                                                 128
         12        DO_ICALL                                         $6      
    4    13        ASSIGN                                                   !0, $6
   28    14        CONCAT                                           ~8      !0, '%0A'
         15        ECHO                                                     ~8
   30    16        INIT_FCALL                                               'json_decode'
         17        SEND_VAR                                                 !0
         18        SEND_VAL                                                 <true>
         19        DO_ICALL                                         $9      
         20        ASSIGN                                                   !0, $9
   32    21        NEW                                              $11     'User_DTO'
         22        SEND_VAR_EX                                              !0
         23        DO_FCALL                                      0          
         24        ASSIGN                                                   !1, $11
   34    25        NEW                                              $14     'User_List_DTO'
   35    26        SEND_VAL_EX                                              <array>
         27        DO_FCALL                                      0          
   34    28        ASSIGN                                                   !2, $14
   40    29        INIT_METHOD_CALL                                         !1, 'get_id'
         30        DO_FCALL                                      0  $17     
         31        CONCAT                                           ~18     $17, '%0A'
         32        ECHO                                                     ~18
   41    33        INIT_METHOD_CALL                                         !1, 'get_name'
         34        DO_FCALL                                      0  $19     
         35        CONCAT                                           ~20     $19, '%0A'
         36        ECHO                                                     ~20
   42    37        INIT_METHOD_CALL                                         !1, 'get_username'
         38        DO_FCALL                                      0  $21     
         39        CONCAT                                           ~22     $21, '%0A'
         40        ECHO                                                     ~22
   44    41        INIT_METHOD_CALL                                         !2, 'get_id'
         42        DO_FCALL                                      0  $23     
         43        CONCAT                                           ~24     $23, '%0A'
         44        ECHO                                                     ~24
   45    45        INIT_METHOD_CALL                                         !2, 'get_name'
         46        DO_FCALL                                      0  $25     
         47        CONCAT                                           ~26     $25, '%0A'
         48        ECHO                                                     ~26
   46    49        INIT_METHOD_CALL                                         !2, 'get_username'
         50        DO_FCALL                                      0  $27     
         51        CONCAT                                           ~28     $27, '%0A'
         52        ECHO                                                     ~28
         53      > JMP                                                      ->58
   47    54  E > > CATCH                                       last         'Exception'
   48    55    >   INIT_METHOD_CALL                                         !3, 'getMessage'
         56        DO_FCALL                                      0  $29     
         57        ECHO                                                     $29
  154    58    > > RETURN                                                   1

Class DTO:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cXIQ2
function name:  __construct
number of ops:  10
compiled vars:  !0 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   55     0  E >   RECV                                             !0      
   56     1        INIT_METHOD_CALL                                         'validate_data_against_schema'
          2        SEND_VAR_EX                                              !0
          3        CHECK_FUNC_ARG                                           
          4        FETCH_OBJ_FUNC_ARG                               $1      'schema'
          5        SEND_FUNC_ARG                                            $1
          6        DO_FCALL                                      0          
   58     7        ASSIGN_OBJ                                               'data'
          8        OP_DATA                                                  !0
   59     9      > RETURN                                                   null

End of function __construct

Function validate_data_against_schema:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 60
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 60
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 16
Branch analysis from position: 8
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 16
2 jumps found. (Code = 46) Position 1 = 18, Position 2 = 22
Branch analysis from position: 18
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 34
Branch analysis from position: 23
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 34
2 jumps found. (Code = 46) Position 1 = 36, Position 2 = 40
Branch analysis from position: 36
2 jumps found. (Code = 43) Position 1 = 41, Position 2 = 52
Branch analysis from position: 41
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 52
2 jumps found. (Code = 43) Position 1 = 54, Position 2 = 59
Branch analysis from position: 54
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 59
Branch analysis from position: 40
Branch analysis from position: 22
Branch analysis from position: 60
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 60
filename:       /in/cXIQ2
function name:  validate_data_against_schema
number of ops:  62
compiled vars:  !0 = $data, !1 = $schema, !2 = $value, !3 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   61     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   62     2      > FE_RESET_R                                       $4      !1, ->60
          3    > > FE_FETCH_R                                       ~5      $4, !2, ->60
          4    >   ASSIGN                                                   !3, ~5
   63     5        ARRAY_KEY_EXISTS                                 ~7      !3, !0
          6        BOOL_NOT                                         ~8      ~7
          7      > JMPZ                                                     ~8, ->16
   64     8    >   NEW                                              $9      'UnexpectedValueException'
          9        INIT_FCALL                                               'sprintf'
         10        SEND_VAL                                                 'Required+key+%22%25s%22+does+not+exist.'
         11        SEND_VAR                                                 !3
         12        DO_ICALL                                         $10     
         13        SEND_VAR_NO_REF_EX                                       $10
         14        DO_FCALL                                      0          
         15      > THROW                                         0          $9
   69    16    >   TYPE_CHECK                                  124  ~12     !2
         17      > JMPZ_EX                                          ~12     ~12, ->22
         18    >   FETCH_DIM_R                                      ~13     !0, !3
         19        TYPE_CHECK                                  124  ~14     ~13
         20        BOOL_NOT                                         ~15     ~14
         21        BOOL                                             ~12     ~15
         22    > > JMPZ                                                     ~12, ->34
   70    23    >   NEW                                              $16     'UnexpectedValueException'
         24        INIT_FCALL                                               'sprintf'
   71    25        SEND_VAL                                                 'Key+%22%25s%22+must+be+scalar%2C+%25s+provided.'
   72    26        SEND_VAR                                                 !3
   73    27        FETCH_DIM_R                                      ~17     !0, !3
         28        GET_TYPE                                         ~18     ~17
         29        SEND_VAL                                                 ~18
         30        DO_ICALL                                         $19     
         31        SEND_VAR_NO_REF_EX                                       $19
         32        DO_FCALL                                      0          
         33      > THROW                                         0          $16
   79    34    >   TYPE_CHECK                                  128  ~21     !2
         35      > JMPZ_EX                                          ~21     ~21, ->40
         36    >   FETCH_DIM_R                                      ~22     !0, !3
         37        TYPE_CHECK                                  128  ~23     ~22
         38        BOOL_NOT                                         ~24     ~23
         39        BOOL                                             ~21     ~24
         40    > > JMPZ                                                     ~21, ->52
   80    41    >   NEW                                              $25     'UnexpectedValueException'
         42        INIT_FCALL                                               'sprintf'
   81    43        SEND_VAL                                                 'Key+%22%25s%22+must+be+an+array%2C+%25s+provided.'
   82    44        SEND_VAR                                                 !3
   83    45        FETCH_DIM_R                                      ~26     !0, !3
         46        GET_TYPE                                         ~27     ~26
         47        SEND_VAL                                                 ~27
         48        DO_ICALL                                         $28     
         49        SEND_VAR_NO_REF_EX                                       $28
         50        DO_FCALL                                      0          
         51      > THROW                                         0          $25
   88    52    >   TYPE_CHECK                                  128          !2
         53      > JMPZ                                                     ~30, ->59
   89    54    >   INIT_METHOD_CALL                                         'validate_data_against_schema'
         55        FETCH_DIM_R                                      ~31     !0, !3
         56        SEND_VAL                                                 ~31
         57        SEND_VAR                                                 !2
         58        DO_FCALL                                      0          
   62    59    > > JMP                                                      ->3
         60    >   FE_FREE                                                  $4
   92    61      > RETURN                                                   null

End of function validate_data_against_schema

End of class DTO.

Class User_DTO:
Function get_id:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cXIQ2
function name:  get_id
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  122     0  E >   FETCH_OBJ_R                                      ~0      'data'
          1        FETCH_DIM_R                                      ~1      ~0, 'id'
          2        CAST                                          6  ~2      ~1
          3        VERIFY_RETURN_TYPE                                       ~2
          4      > RETURN                                                   ~2
  123     5*       VERIFY_RETURN_TYPE                                       
          6*     > RETURN                                                   null

End of function get_id

Function get_name:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cXIQ2
function name:  get_name
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  126     0  E >   FETCH_OBJ_R                                      ~0      'data'
          1        FETCH_DIM_R                                      ~1      ~0, 'name'
          2        CAST                                          6  ~2      ~1
          3        VERIFY_RETURN_TYPE                                       ~2
          4      > RETURN                                                   ~2
  127     5*       VERIFY_RETURN_TYPE                                       
          6*     > RETURN                                                   null

End of function get_name

Function get_username:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cXIQ2
function name:  get_username
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  130     0  E >   FETCH_OBJ_R                                      ~0      'data'
          1        FETCH_DIM_R                                      ~1      ~0, 'username'
          2        CAST                                          6  ~2      ~1
          3        VERIFY_RETURN_TYPE                                       ~2
          4      > RETURN                                                   ~2
  131     5*       VERIFY_RETURN_TYPE                                       
          6*     > RETURN                                                   null

End of function get_username

Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cXIQ2
function name:  __construct
number of ops:  10
compiled vars:  !0 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   55     0  E >   RECV                                             !0      
   56     1        INIT_METHOD_CALL                                         'validate_data_against_schema'
          2        SEND_VAR_EX                                              !0
          3        CHECK_FUNC_ARG                                           
          4        FETCH_OBJ_FUNC_ARG                               $1      'schema'
          5        SEND_FUNC_ARG                                            $1
          6        DO_FCALL                                      0          
   58     7        ASSIGN_OBJ                                               'data'
          8        OP_DATA                                                  !0
   59     9      > RETURN                                                   null

End of function __construct

Function validate_data_against_schema:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 60
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 60
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 16
Branch analysis from position: 8
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 16
2 jumps found. (Code = 46) Position 1 = 18, Position 2 = 22
Branch analysis from position: 18
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 34
Branch analysis from position: 23
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 34
2 jumps found. (Code = 46) Position 1 = 36, Position 2 = 40
Branch analysis from position: 36
2 jumps found. (Code = 43) Position 1 = 41, Position 2 = 52
Branch analysis from position: 41
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 52
2 jumps found. (Code = 43) Position 1 = 54, Position 2 = 59
Branch analysis from position: 54
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 59
Branch analysis from position: 40
Branch analysis from position: 22
Branch analysis from position: 60
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 60
filename:       /in/cXIQ2
function name:  validate_data_against_schema
number of ops:  62
compiled vars:  !0 = $data, !1 = $schema, !2 = $value, !3 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   61     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   62     2      > FE_RESET_R                                       $4      !1, ->60
          3    > > FE_FETCH_R                                       ~5      $4, !2, ->60
          4    >   ASSIGN                                                   !3, ~5
   63     5        ARRAY_KEY_EXISTS                                 ~7      !3, !0
          6        BOOL_NOT                                         ~8      ~7
          7      > JMPZ                                                     ~8, ->16
   64     8    >   NEW                                              $9      'UnexpectedValueException'
          9        INIT_FCALL                                               'sprintf'
         10        SEND_VAL                                                 'Required+key+%22%25s%22+does+not+exist.'
         11        SEND_VAR                                                 !3
         12        DO_ICALL                                         $10     
         13        SEND_VAR_NO_REF_EX                                       $10
         14        DO_FCALL                                      0          
         15      > THROW                                         0          $9
   69    16    >   TYPE_CHECK                                  124  ~12     !2
         17      > JMPZ_EX                                          ~12     ~12, ->22
         18    >   FETCH_DIM_R                                      ~13     !0, !3
         19        TYPE_CHECK                                  124  ~14     ~13
         20        BOOL_NOT                                         ~15     ~14
         21        BOOL                                             ~12     ~15
         22    > > JMPZ                                                     ~12, ->34
   70    23    >   NEW                                              $16     'UnexpectedValueException'
         24        INIT_FCALL                                               'sprintf'
   71    25        SEND_VAL                                                 'Key+%22%25s%22+must+be+scalar%2C+%25s+provided.'
   72    26        SEND_VAR                                                 !3
   73    27        FETCH_DIM_R                                      ~17     !0, !3
         28        GET_TYPE                                         ~18     ~17
         29        SEND_VAL                                                 ~18
         30        DO_ICALL                                         $19     
         31        SEND_VAR_NO_REF_EX                                       $19
         32        DO_FCALL                                      0          
         33      > THROW                                         0          $16
   79    34    >   TYPE_CHECK                                  128  ~21     !2
         35      > JMPZ_EX                                          ~21     ~21, ->40
         36    >   FETCH_DIM_R                                      ~22     !0, !3
         37        TYPE_CHECK                                  128  ~23     ~22
         38        BOOL_NOT                                         ~24     ~23
         39        BOOL                                             ~21     ~24
         40    > > JMPZ                                                     ~21, ->52
   80    41    >   NEW                                              $25     'UnexpectedValueException'
         42        INIT_FCALL                                               'sprintf'
   81    43        SEND_VAL                                                 'Key+%22%25s%22+must+be+an+array%2C+%25s+provided.'
   82    44        SEND_VAR                                                 !3
   83    45        FETCH_DIM_R                                      ~26     !0, !3
         46        GET_TYPE                                         ~27     ~26
         47        SEND_VAL                                                 ~27
         48        DO_ICALL                                         $28     
         49        SEND_VAR_NO_REF_EX                                       $28
         50        DO_FCALL                                      0          
         51      > THROW                                         0          $25
   88    52    >   TYPE_CHECK                                  128          !2
         53      > JMPZ                                                     ~30, ->59
   89    54    >   INIT_METHOD_CALL                                         'validate_data_against_schema'
         55        FETCH_DIM_R                                      ~31     !0, !3
         56        SEND_VAL                                                 ~31
         57        SEND_VAR                                                 !2
         58        DO_FCALL                                      0          
   62    59    > > JMP                                                      ->3
         60    >   FE_FREE                                                  $4
   92    61      > RETURN                                                   null

End of function validate_data_against_schema

End of class User_DTO.

Class User_List_DTO:
Function get_id:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cXIQ2
function name:  get_id
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  144     0  E >   FETCH_OBJ_R                                      ~0      'data'
          1        FETCH_DIM_R                                      ~1      ~0, 'id'
          2        CAST                                          6  ~2      ~1
          3        VERIFY_RETURN_TYPE                                       ~2
          4      > RETURN                                                   ~2
  145     5*       VERIFY_RETURN_TYPE                                       
          6*     > RETURN                                                   null

End of function get_id

Function get_name:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cXIQ2
function name:  get_name
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  148     0  E >   FETCH_OBJ_R                                      ~0      'data'
          1        FETCH_DIM_R                                      ~1      ~0, 'name'
          2        CAST                                          6  ~2      ~1
          3        VERIFY_RETURN_TYPE                                       ~2
          4      > RETURN                                                   ~2
  149     5*       VERIFY_RETURN_TYPE                                       
          6*     > RETURN                                                   null

End of function get_name

Function get_username:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cXIQ2
function name:  get_username
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  152     0  E >   FETCH_OBJ_R                                      ~0      'data'
          1        FETCH_DIM_R                                      ~1      ~0, 'username'
          2        CAST                                          6  ~2      ~1
          3        VERIFY_RETURN_TYPE                                       ~2
          4      > RETURN                                                   ~2
  153     5*       VERIFY_RETURN_TYPE                                       
          6*     > RETURN                                                   null

End of function get_username

Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cXIQ2
function name:  __construct
number of ops:  10
compiled vars:  !0 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   55     0  E >   RECV                                             !0      
   56     1        INIT_METHOD_CALL                                         'validate_data_against_schema'
          2        SEND_VAR_EX                                              !0
          3        CHECK_FUNC_ARG                                           
          4        FETCH_OBJ_FUNC_ARG                               $1      'schema'
          5        SEND_FUNC_ARG                                            $1
          6        DO_FCALL                                      0          
   58     7        ASSIGN_OBJ                                               'data'
          8        OP_DATA                                                  !0
   59     9      > RETURN                                                   null

End of function __construct

Function validate_data_against_schema:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 60
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 60
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 16
Branch analysis from position: 8
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 16
2 jumps found. (Code = 46) Position 1 = 18, Position 2 = 22
Branch analysis from position: 18
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 34
Branch analysis from position: 23
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 34
2 jumps found. (Code = 46) Position 1 = 36, Position 2 = 40
Branch analysis from position: 36
2 jumps found. (Code = 43) Position 1 = 41, Position 2 = 52
Branch analysis from position: 41
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 52
2 jumps found. (Code = 43) Position 1 = 54, Position 2 = 59
Branch analysis from position: 54
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 59
Branch analysis from position: 40
Branch analysis from position: 22
Branch analysis from position: 60
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 60
filename:       /in/cXIQ2
function name:  validate_data_against_schema
number of ops:  62
compiled vars:  !0 = $data, !1 = $schema, !2 = $value, !3 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   61     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   62     2      > FE_RESET_R                                       $4      !1, ->60
          3    > > FE_FETCH_R                                       ~5      $4, !2, ->60
          4    >   ASSIGN                                                   !3, ~5
   63     5        ARRAY_KEY_EXISTS                                 ~7      !3, !0
          6        BOOL_NOT                                         ~8      ~7
          7      > JMPZ                                                     ~8, ->16
   64     8    >   NEW                                              $9      'UnexpectedValueException'
          9        INIT_FCALL                                               'sprintf'
         10        SEND_VAL                                                 'Required+key+%22%25s%22+does+not+exist.'
         11        SEND_VAR                                                 !3
         12        DO_ICALL                                         $10     
         13        SEND_VAR_NO_REF_EX                                       $10
         14        DO_FCALL                                      0          
         15      > THROW                                         0          $9
   69    16    >   TYPE_CHECK                                  124  ~12     !2
         17      > JMPZ_EX                                          ~12     ~12, ->22
         18    >   FETCH_DIM_R                                      ~13     !0, !3
         19        TYPE_CHECK                                  124  ~14     ~13
         20        BOOL_NOT                                         ~15     ~14
         21        BOOL                                      

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
250.54 ms | 1428 KiB | 20 Q