3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Foo { interface FooInterface { public function foo(string $str); } } namespace Bar { use Foo\FooInterface; class BarClass implements FooInterface { public function foo(string $str) { } } if (version_compare(PHP_VERSION, '7.0', '<')) { function type_hint($code, $error) { if (strpos($error, 'string, string') !== false) { return true; } if (strpos($error, 'int, integer') !== false) { return true; } if (strpos($error, 'bool, boolean') !== false) { return true; } if (strpos($error, 'float, double') !== false) { return true; } return false; } } set_error_handler('type_hint', E_RECOVERABLE_ERROR); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 9
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
filename:       /in/Jnclu
function name:  (null)
number of ops:  15
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   DECLARE_CLASS                                            'bar%5Cbarclass'
   20     1        INIT_NS_FCALL_BY_NAME                                    'Bar%5Cversion_compare'
          2        FETCH_CONSTANT                                   ~0      'Bar%5CPHP_VERSION'
          3        SEND_VAL_EX                                              ~0
          4        SEND_VAL_EX                                              '7.0'
          5        SEND_VAL_EX                                              '%3C'
          6        DO_FCALL                                      0  $1      
          7      > JMPZ                                                     $1, ->9
   22     8    >   DECLARE_FUNCTION                                         'bar%5Ctype_hint'
   44     9    >   INIT_NS_FCALL_BY_NAME                                    'Bar%5Cset_error_handler'
         10        SEND_VAL_EX                                              'type_hint'
         11        FETCH_CONSTANT                                   ~2      'Bar%5CE_RECOVERABLE_ERROR'
         12        SEND_VAL_EX                                              ~2
         13        DO_FCALL                                      0          
   45    14      > RETURN                                                   1

Function %00bar%5Ctype_hint%2Fin%2FJnclu%3A22%241:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 9
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 16
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 23
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
2 jumps found. (Code = 43) Position 1 = 29, Position 2 = 30
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 30
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Jnclu
function name:  Bar\type_hint
number of ops:  32
compiled vars:  !0 = $code, !1 = $error
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   24     2        INIT_NS_FCALL_BY_NAME                                    'Bar%5Cstrpos'
          3        SEND_VAR_EX                                              !1
          4        SEND_VAL_EX                                              'string%2C+string'
          5        DO_FCALL                                      0  $2      
          6        TYPE_CHECK                                  1018          $2
          7      > JMPZ                                                     ~3, ->9
   25     8    > > RETURN                                                   <true>
   28     9    >   INIT_NS_FCALL_BY_NAME                                    'Bar%5Cstrpos'
         10        SEND_VAR_EX                                              !1
         11        SEND_VAL_EX                                              'int%2C+integer'
         12        DO_FCALL                                      0  $4      
         13        TYPE_CHECK                                  1018          $4
         14      > JMPZ                                                     ~5, ->16
   29    15    > > RETURN                                                   <true>
   32    16    >   INIT_NS_FCALL_BY_NAME                                    'Bar%5Cstrpos'
         17        SEND_VAR_EX                                              !1
         18        SEND_VAL_EX                                              'bool%2C+boolean'
         19        DO_FCALL                                      0  $6      
         20        TYPE_CHECK                                  1018          $6
         21      > JMPZ                                                     ~7, ->23
   33    22    > > RETURN                                                   <true>
   36    23    >   INIT_NS_FCALL_BY_NAME                                    'Bar%5Cstrpos'
         24        SEND_VAR_EX                                              !1
         25        SEND_VAL_EX                                              'float%2C+double'
         26        DO_FCALL                                      0  $8      
         27        TYPE_CHECK                                  1018          $8
         28      > JMPZ                                                     ~9, ->30
   37    29    > > RETURN                                                   <true>
   40    30    > > RETURN                                                   <false>
   41    31*     > RETURN                                                   null

End of function %00bar%5Ctype_hint%2Fin%2FJnclu%3A22%241

Class Foo\FooInterface:
Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Jnclu
function name:  foo
number of ops:  2
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1      > RETURN                                                   null

End of function foo

End of class Foo\FooInterface.

Class Bar\BarClass:
Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Jnclu
function name:  foo
number of ops:  2
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
          1      > RETURN                                                   null

End of function foo

End of class Bar\BarClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
175.08 ms | 1400 KiB | 19 Q