3v4l.org

run code in 300+ PHP versions simultaneously
<?php $corban_notice = false; if (!function_exists('cd')) { function cd($var) { global $corban_notice; if (!isset($var)) { if ($corban_notice) { echo 'cd: Variable is not set'.PHP_EOL; $corban_notice = false; } else { echo 'cd: Variable is NULL'.PHP_EOL; } } } } function corban_error_handler($errno , $errstr, $errfile, $errline) { global $corban_notice; 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 ') { $corban_notice = true; } } 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 = 6, Position 2 = 7
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
filename:       /in/UfhfQ
function name:  (null)
number of ops:  22
compiled vars:  !0 = $corban_notice, !1 = $a, !2 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <false>
    5     1        INIT_FCALL                                               'function_exists'
          2        SEND_VAL                                                 'cd'
          3        DO_ICALL                                         $4      
          4        BOOL_NOT                                         ~5      $4
          5      > JMPZ                                                     ~5, ->7
    7     6    >   DECLARE_FUNCTION                                         'cd'
   42     7    >   INIT_FCALL                                               'set_error_handler'
          8        SEND_VAL                                                 'corban_error_handler'
          9        SEND_VAL                                                 8
         10        DO_ICALL                                                 
   44    11        INIT_FCALL                                               'var_dump'
         12        SEND_VAR                                                 !1
         13        DO_ICALL                                                 
   45    14        ASSIGN                                                   !2, null
   46    15        INIT_FCALL_BY_NAME                                       'cd'
         16        SEND_VAR_EX                                              !1
         17        DO_FCALL                                      0          
   47    18        INIT_FCALL_BY_NAME                                       'cd'
         19        SEND_VAR_EX                                              !2
         20        DO_FCALL                                      0          
         21      > RETURN                                                   1

Function %00cd%2Fin%2FUfhfQ%3A7%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 10
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 9
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
filename:       /in/UfhfQ
function name:  cd
number of ops:  11
compiled vars:  !0 = $var, !1 = $corban_notice
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    9     1        BIND_GLOBAL                                              !1, 'corban_notice'
   10     2        ISSET_ISEMPTY_CV                                 ~2      !0
          3        BOOL_NOT                                         ~3      ~2
          4      > JMPZ                                                     ~3, ->10
   12     5    > > JMPZ                                                     !1, ->9
   14     6    >   ECHO                                                     'cd%3A+Variable+is+not+set%0A'
   15     7        ASSIGN                                                   !1, <false>
          8      > JMP                                                      ->10
   19     9    >   ECHO                                                     'cd%3A+Variable+is+NULL%0A'
   22    10    > > RETURN                                                   null

End of function %00cd%2Fin%2FUfhfQ%3A7%240

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

End of function corban_error_handler

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.91 ms | 1404 KiB | 25 Q