3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test {function mb_strlen($v){return mb_strlen($v);}} $type = 'mb_str'; $obj = new Test; if (version_compare(PHP_VERSION, "7.0", ">=")) { echo eval('return $obj->{$type . "len"}($type);'); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 12
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/mGOCD
function name:  (null)
number of ops:  13
compiled vars:  !0 = $type, !1 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, 'mb_str'
    5     1        NEW                                              $3      'Test'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $3
    6     4        INIT_FCALL                                               'version_compare'
          5        SEND_VAL                                                 '8.0.0'
          6        SEND_VAL                                                 '7.0'
          7        SEND_VAL                                                 '%3E%3D'
          8        DO_ICALL                                         $6      
          9      > JMPZ                                                     $6, ->12
    7    10    >   INCLUDE_OR_EVAL                                  $7      'return+%24obj-%3E%7B%24type+.+%22len%22%7D%28%24type%29%3B', EVAL
         11        ECHO                                                     $7
    8    12    > > RETURN                                                   1

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

End of function mb_strlen

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.82 ms | 1395 KiB | 17 Q