3v4l.org

run code in 500+ PHP versions simultaneously
<?php abstract class ModelRecord { const TABLE = ''; const PRIMARY = ''; public function load($id) { if(self::TABLE === static::TABLE OR self::PRIMARY === static::PRIMARY) throw new UnexpectedValueException("TABLE or PRIMARY const not implemented"); var_dump(static::TABLE, static::PRIMARY); } } class User extends ModelRecord { const TABLE = 'users'; const PRIMARY = 'id'; } class Contact extends ModelRecord { } (new User)->load(1); (new Contact)->load(2);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AlUal
function name:  (null)
number of ops:  11
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   25     0  E >   NEW                                                  $0      'User'
          1        DO_FCALL                                          0          
          2        INIT_METHOD_CALL                                             $0, 'load'
          3        SEND_VAL_EX                                                  1
          4        DO_FCALL                                          0          
   26     5        NEW                                                  $3      'Contact'
          6        DO_FCALL                                          0          
          7        INIT_METHOD_CALL                                             $3, 'load'
          8        SEND_VAL_EX                                                  2
          9        DO_FCALL                                          0          
         10      > RETURN                                                       1

Class ModelRecord:
Function load:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 4, Position 2 = 7
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 12
Branch analysis from position: 8
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
filename:       /in/AlUal
function name:  load
number of ops:  19
compiled vars:  !0 = $id
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    7     0  E >   RECV                                                 !0      
    9     1        FETCH_CLASS_CONSTANT                                 ~1      'TABLE'
          2        IS_IDENTICAL                                         ~2      ~1, ''
          3      > JMPNZ_EX                                             ~2      ~2, ->7
          4    >   FETCH_CLASS_CONSTANT                                 ~3      'PRIMARY'
          5        IS_IDENTICAL                                         ~4      ~3, ''
          6        BOOL                                                 ~2      ~4
          7    > > JMPZ                                                         ~2, ->12
   10     8    >   NEW                                                  $5      'UnexpectedValueException'
          9        SEND_VAL_EX                                                  'TABLE+or+PRIMARY+const+not+implemented'
         10        DO_FCALL                                          0          
         11      > THROW                                             0          $5
   12    12    >   INIT_FCALL                                                   'var_dump'
         13        FETCH_CLASS_CONSTANT                                 ~7      'TABLE'
         14        SEND_VAL                                                     ~7
         15        FETCH_CLASS_CONSTANT                                 ~8      'PRIMARY'
         16        SEND_VAL                                                     ~8
         17        DO_ICALL                                                     
   13    18      > RETURN                                                       null

End of function load

End of class ModelRecord.

Class User:
Function load:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 4, Position 2 = 7
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 12
Branch analysis from position: 8
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
filename:       /in/AlUal
function name:  load
number of ops:  19
compiled vars:  !0 = $id
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    7     0  E >   RECV                                                 !0      
    9     1        FETCH_CLASS_CONSTANT                                 ~1      'TABLE'
          2        IS_IDENTICAL                                         ~2      ~1, ''
          3      > JMPNZ_EX                                             ~2      ~2, ->7
          4    >   FETCH_CLASS_CONSTANT                                 ~3      'PRIMARY'
          5        IS_IDENTICAL                                         ~4      ~3, ''
          6        BOOL                                                 ~2      ~4
          7    > > JMPZ                                                         ~2, ->12
   10     8    >   NEW                                                  $5      'UnexpectedValueException'
          9        SEND_VAL_EX                                                  'TABLE+or+PRIMARY+const+not+implemented'
         10        DO_FCALL                                          0          
         11      > THROW                                             0          $5
   12    12    >   INIT_FCALL                                                   'var_dump'
         13        FETCH_CLASS_CONSTANT                                 ~7      'TABLE'
         14        SEND_VAL                                                     ~7
         15        FETCH_CLASS_CONSTANT                                 ~8      'PRIMARY'
         16        SEND_VAL                                                     ~8
         17        DO_ICALL                                                     
   13    18      > RETURN                                                       null

End of function load

End of class User.

Class Contact:
Function load:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 4, Position 2 = 7
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 12
Branch analysis from position: 8
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
filename:       /in/AlUal
function name:  load
number of ops:  19
compiled vars:  !0 = $id
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    7     0  E >   RECV                                                 !0      
    9     1        FETCH_CLASS_CONSTANT                                 ~1      'TABLE'
          2        IS_IDENTICAL                                         ~2      ~1, ''
          3      > JMPNZ_EX                                             ~2      ~2, ->7
          4    >   FETCH_CLASS_CONSTANT                                 ~3      'PRIMARY'
          5        IS_IDENTICAL                                         ~4      ~3, ''
          6        BOOL                                                 ~2      ~4
          7    > > JMPZ                                                         ~2, ->12
   10     8    >   NEW                                                  $5      'UnexpectedValueException'
          9        SEND_VAL_EX                                                  'TABLE+or+PRIMARY+const+not+implemented'
         10        DO_FCALL                                          0          
         11      > THROW                                             0          $5
   12    12    >   INIT_FCALL                                                   'var_dump'
         13        FETCH_CLASS_CONSTANT                                 ~7      'TABLE'
         14        SEND_VAL                                                     ~7
         15        FETCH_CLASS_CONSTANT                                 ~8      'PRIMARY'
         16        SEND_VAL                                                     ~8
         17        DO_ICALL                                                     
   13    18      > RETURN                                                       null

End of function load

End of class Contact.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
234.95 ms | 2191 KiB | 14 Q