3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { public function testing($output) { echo $output; } } $class = new Test(); $exec = array($class, "testing"); echo "Version 1: " . $exec("hello") . "\n"; echo "Version 2: " . call_user_func_array($exec, array("hello"));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SZ42G
function name:  (null)
number of ops:  19
compiled vars:  !0 = $class, !1 = $exec
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   NEW                                              $2      'Test'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   11     3        INIT_ARRAY                                       ~5      !0
          4        ADD_ARRAY_ELEMENT                                ~5      'testing'
          5        ASSIGN                                                   !1, ~5
   13     6        INIT_DYNAMIC_CALL                                        !1
          7        SEND_VAL_EX                                              'hello'
          8        DO_FCALL                                      0  $7      
          9        CONCAT                                           ~8      'Version+1%3A+', $7
         10        CONCAT                                           ~9      ~8, '%0A'
         11        ECHO                                                     ~9
   14    12        INIT_USER_CALL                                0          'call_user_func_array', !1
         13        SEND_ARRAY                                               <array>
         14        CHECK_UNDEF_ARGS                                         
         15        DO_FCALL                                      0  $10     
         16        CONCAT                                           ~11     'Version+2%3A+', $10
         17        ECHO                                                     ~11
         18      > RETURN                                                   1

Class Test:
Function testing:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SZ42G
function name:  testing
number of ops:  3
compiled vars:  !0 = $output
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    6     1        ECHO                                                     !0
    7     2      > RETURN                                                   null

End of function testing

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
124.78 ms | 1398 KiB | 13 Q