3v4l.org

run code in 300+ PHP versions simultaneously
<?php $drupal_version = 10.0; if (version_compare($drupal_version, '8.0')) { interface I { // In Symfony 5.4 this is: // public static function test($s, $i, $m); // In Symfony 6.0 this is: public static function test(string $s, int $i, mixed $m): mixed; } } else { interface I { // In Symfony 5.4 this is: // public static function test($s, $i, $m); // In Symfony 6.0 this is: public static function test($s, $i, $m); } } if (version_compare($drupal_version, '8.0')) { class A implements I { public static function test(string $s, int $i, mixed $m): mixed { return 'hello'; } } } else { class A implements I { public static function test($s, $i, $m) { return 'hello'; } } } A::test('string', 1, '');
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
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 16
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 16
Branch analysis from position: 14
Branch analysis from position: 16
filename:       /in/QnVTu
function name:  (null)
number of ops:  23
compiled vars:  !0 = $drupal_version
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 10
    4     1        INIT_FCALL                                               'version_compare'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 '8.0'
          4        DO_ICALL                                         $2      
          5      > JMPZ                                                     $2, ->8
    5     6    >   DECLARE_CLASS                                            'i'
          7      > JMP                                                      ->9
   13     8    >   DECLARE_CLASS                                            'i'
   22     9    >   INIT_FCALL                                               'version_compare'
         10        SEND_VAR                                                 !0
         11        SEND_VAL                                                 '8.0'
         12        DO_ICALL                                         $3      
         13      > JMPZ                                                     $3, ->16
   23    14    >   DECLARE_CLASS                                            'a'
         15      > JMP                                                      ->17
   30    16    >   DECLARE_CLASS                                            'a'
   37    17    >   INIT_STATIC_METHOD_CALL                                  'A', 'test'
         18        SEND_VAL_EX                                              'string'
         19        SEND_VAL_EX                                              1
         20        SEND_VAL_EX                                              ''
         21        DO_FCALL                                      0          
         22      > RETURN                                                   1

Class I:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QnVTu
function name:  test
number of ops:  5
compiled vars:  !0 = $s, !1 = $i, !2 = $m
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        VERIFY_RETURN_TYPE                                       
          4      > RETURN                                                   null

End of function test

End of class I.

Class I:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QnVTu
function name:  test
number of ops:  4
compiled vars:  !0 = $s, !1 = $i, !2 = $m
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3      > RETURN                                                   null

End of function test

End of class I.

Class A:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QnVTu
function name:  test
number of ops:  6
compiled vars:  !0 = $s, !1 = $i, !2 = $m
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
   25     3      > RETURN                                                   'hello'
   26     4*       VERIFY_RETURN_TYPE                                       
          5*     > RETURN                                                   null

End of function test

End of class A.

Class A:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QnVTu
function name:  test
number of ops:  5
compiled vars:  !0 = $s, !1 = $i, !2 = $m
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   31     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
   32     3      > RETURN                                                   'hello'
   33     4*     > RETURN                                                   null

End of function test

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.5 ms | 1405 KiB | 15 Q