3v4l.org

run code in 300+ PHP versions simultaneously
<?php if (!function_exists('cd')) { function cd($var) { var_dump($var); } } function corban_error_handler($errno , $errstr, $errfile, $errline) { if ( version_compare(PHP_VERSION, '5.0.0', '>=') ) { $file = new SplFileObject($errfile); $file->seek($errline-1); $c = substr(trim($file->current()), 0, 3); if ($c=='cd(' || $c=='cd ') { cd($c); } } return false; } set_error_handler ('corban_error_handler', E_NOTICE); var_dump($a); $b = null; cd($a); cd($b);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 6
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
filename:       /in/MMsdY
function name:  (null)
number of ops:  21
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'function_exists'
          1        SEND_VAL                                                 'cd'
          2        DO_ICALL                                         $2      
          3        BOOL_NOT                                         ~3      $2
          4      > JMPZ                                                     ~3, ->6
    5     5    >   DECLARE_FUNCTION                                         'cd'
   28     6    >   INIT_FCALL                                               'set_error_handler'
          7        SEND_VAL                                                 'corban_error_handler'
          8        SEND_VAL                                                 8
          9        DO_ICALL                                                 
   30    10        INIT_FCALL                                               'var_dump'
         11        SEND_VAR                                                 !0
         12        DO_ICALL                                                 
   31    13        ASSIGN                                                   !1, null
   32    14        INIT_FCALL_BY_NAME                                       'cd'
         15        SEND_VAR_EX                                              !0
         16        DO_FCALL                                      0          
   33    17        INIT_FCALL_BY_NAME                                       'cd'
         18        SEND_VAR_EX                                              !1
         19        DO_FCALL                                      0          
         20      > RETURN                                                   1

Function %00cd%2Fin%2FMMsdY%3A5%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MMsdY
function name:  cd
number of ops:  5
compiled vars:  !0 = $var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    7     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
    8     4      > RETURN                                                   null

End of function %00cd%2Fin%2FMMsdY%3A5%240

Function corban_error_handler:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 37
Branch analysis from position: 10
2 jumps found. (Code = 47) Position 1 = 31, Position 2 = 33
Branch analysis from position: 31
2 jumps found. (Code = 43) Position 1 = 34, Position 2 = 37
Branch analysis from position: 34
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 37
Branch analysis from position: 33
Branch analysis from position: 37
filename:       /in/MMsdY
function name:  corban_error_handler
number of ops:  39
compiled vars:  !0 = $errno, !1 = $errstr, !2 = $errfile, !3 = $errline, !4 = $file, !5 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV                                             !3      
   14     4        INIT_FCALL                                               'version_compare'
          5        SEND_VAL                                                 '8.0.0'
          6        SEND_VAL                                                 '5.0.0'
          7        SEND_VAL                                                 '%3E%3D'
          8        DO_ICALL                                         $6      
          9      > JMPZ                                                     $6, ->37
   16    10    >   NEW                                              $7      'SplFileObject'
         11        SEND_VAR_EX                                              !2
         12        DO_FCALL                                      0          
         13        ASSIGN                                                   !4, $7
   17    14        INIT_METHOD_CALL                                         !4, 'seek'
         15        SUB                                              ~10     !3, 1
         16        SEND_VAL_EX                                              ~10
         17        DO_FCALL                                      0          
   18    18        INIT_FCALL                                               'substr'
         19        INIT_FCALL                                               'trim'
         20        INIT_METHOD_CALL                                         !4, 'current'
         21        DO_FCALL                                      0  $12     
         22        SEND_VAR                                                 $12
         23        DO_ICALL                                         $13     
         24        SEND_VAR                                                 $13
         25        SEND_VAL                                                 0
         26        SEND_VAL                                                 3
         27        DO_ICALL                                         $14     
         28        ASSIGN                                                   !5, $14
   19    29        IS_EQUAL                                         ~16     !5, 'cd%28'
         30      > JMPNZ_EX                                         ~16     ~16, ->33
         31    >   IS_EQUAL                                         ~17     !5, 'cd+'
         32        BOOL                                             ~16     ~17
         33    > > JMPZ                                                     ~16, ->37
   21    34    >   INIT_FCALL_BY_NAME                                       'cd'
         35        SEND_VAR_EX                                              !5
         36        DO_FCALL                                      0          
   24    37    > > RETURN                                                   <false>
   26    38*     > RETURN                                                   null

End of function corban_error_handler

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.1 ms | 1392 KiB | 25 Q