3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Foo{ public static function Bar(&$v){ $v = 9000; } } $functionname = "Foo::Bar"; $num = 3; if (stristr('::', $functionname) !== false) { list($class, $function) = explode('::', $functionname); $class::$function($num); } else { $functionname($num); } echo $num;
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = 9, Position 2 = 23
Branch analysis from position: 9
Jump found. Position 1 = 26
Branch analysis from position: 26
Jump found. Position 1 = -2
Branch analysis from position: 23
Jump found. Position 1 = -2
filename:       /in/FEB4S
function name:  (null)
number of ops:  28
compiled vars:  !0 = $functionname, !1 = $num, !2 = $class, !3 = $function
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   2     0  E >   NOP                                                      
   8     1        ASSIGN                                                   !0, 'Foo%3A%3ABar'
   9     2        ASSIGN                                                   !1, 3
  11     3        INIT_FCALL                                               'stristr'
         4        SEND_VAL                                                 '%3A%3A'
         5        SEND_VAR                                                 !0
         6        DO_ICALL                                         $7      
         7        IS_NOT_IDENTICAL                                 ~8      $7, <false>
         8      > JMPZ                                                     ~8, ->23
  12     9    >   INIT_FCALL                                               'explode'
        10        SEND_VAL                                                 '%3A%3A'
        11        SEND_VAR                                                 !0
        12        DO_ICALL                                         $9      
        13        FETCH_LIST                                       $10     $9, 0
        14        ASSIGN                                                   !2, $10
        15        FETCH_LIST                                       $12     $9, 1
        16        ASSIGN                                                   !3, $12
        17        FREE                                                     $9
  13    18        FETCH_CLASS                                 512  :14     !2
        19        INIT_STATIC_METHOD_CALL                                  $14, !3
        20        SEND_VAR_EX                                              !1
        21        DO_FCALL                                      0          
        22      > JMP                                                      ->26
  15    23    >   INIT_DYNAMIC_CALL                                        !0
        24        SEND_VAR_EX                                              !1
        25        DO_FCALL                                      0          
  18    26    >   ECHO                                                     !1
        27      > RETURN                                                   1

Class Foo:
Function bar:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/FEB4S
function name:  Bar
number of ops:  3
compiled vars:  !0 = $v
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   RECV                                             !0      
   4     1        ASSIGN                                                   !0, 9000
   5     2      > RETURN                                                   null

End of function bar

End of class Foo.

Generated using Vulcan Logic Dumper, using php 7.2.0