3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace A; $version = '10.'; if (str_starts_with($version, '10.')) { class Comparator { public static function test() { echo "a"; } } } else { class Comparator { public static function test() { echo "b"; } } } Comparator::test();
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 8
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MBok8
function name:  (null)
number of ops:  12
compiled vars:  !0 = $version
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ASSIGN                                                   !0, '10.'
    7     1        INIT_NS_FCALL_BY_NAME                                    'A%5Cstr_starts_with'
          2        SEND_VAR_EX                                              !0
          3        SEND_VAL_EX                                              '10.'
          4        DO_FCALL                                      0  $2      
          5      > JMPZ                                                     $2, ->8
    8     6    >   DECLARE_CLASS                                            'a%5Ccomparator'
    7     7      > JMP                                                      ->9
   14     8    >   DECLARE_CLASS                                            'a%5Ccomparator'
   21     9    >   INIT_STATIC_METHOD_CALL                                  'A%5CComparator', 'test'
         10        DO_FCALL                                      0          
         11      > RETURN                                                   1

Class A\Comparator:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MBok8
function name:  test
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   ECHO                                                     'a'
   11     1      > RETURN                                                   null

End of function test

End of class A\Comparator.

Class A\Comparator:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MBok8
function name:  test
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   ECHO                                                     'b'
   17     1      > RETURN                                                   null

End of function test

End of class A\Comparator.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.18 ms | 1432 KiB | 14 Q