3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dir = '/GOOD/MORNING'; $url = '/HELLO/WORLD'; class functionCaller { public function caller($function, ...$args) { return call_user_func_array($function, $args); } } $fc = new functionCaller(); $file = <<<EOT $dir/{$fc->caller('basename',$url)} EOT; echo $file;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rD3FS
function name:  (null)
number of ops:  15
compiled vars:  !0 = $dir, !1 = $url, !2 = $fc, !3 = $file
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%2FGOOD%2FMORNING'
    4     1        ASSIGN                                                   !1, '%2FHELLO%2FWORLD'
   12     2        NEW                                              $6      'functionCaller'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !2, $6
   15     5        ROPE_INIT                                     3  ~11     !0
          6        ROPE_ADD                                      1  ~11     ~11, '%2F'
          7        INIT_METHOD_CALL                                         !2, 'caller'
          8        SEND_VAL_EX                                              'basename'
          9        SEND_VAR_EX                                              !1
         10        DO_FCALL                                      0  $9      
         11        ROPE_END                                      2  ~10     ~11, $9
   14    12        ASSIGN                                                   !3, ~10
   17    13        ECHO                                                     !3
         14      > RETURN                                                   1

Class functionCaller:
Function caller:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rD3FS
function name:  caller
number of ops:  8
compiled vars:  !0 = $function, !1 = $args
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        RECV_VARIADIC                                    !1      
    8     2        INIT_USER_CALL                                0          'call_user_func_array', !0
          3        SEND_ARRAY                                               !1
          4        CHECK_UNDEF_ARGS                                         
          5        DO_FCALL                                      0  $2      
          6      > RETURN                                                   $2
    9     7*     > RETURN                                                   null

End of function caller

End of class functionCaller.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.59 ms | 1394 KiB | 13 Q