3v4l.org

run code in 300+ PHP versions simultaneously
<?php class s { const seven = 7; static $y = array(seven, 'seven', 7); function s($x) { static $y = array(seven, 'seven', 7); $y[] = $x; return $y; } } const seven = 7; function foo($x) { static $y = array(seven, 'seven', 7); $y[] = $x; return $y; } new s(2); var_export(foo(4)); var_export(foo(3));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/k9Etm
function name:  (null)
number of ops:  18
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   DECLARE_CONST                                            'seven', 7
   20     1        NEW                                              $0      's'
          2        SEND_VAL_EX                                              2
          3        DO_FCALL                                      0          
          4        FREE                                                     $0
   21     5        INIT_FCALL                                               'var_export'
          6        INIT_FCALL                                               'foo'
          7        SEND_VAL                                                 4
          8        DO_FCALL                                      0  $2      
          9        SEND_VAR                                                 $2
         10        DO_ICALL                                                 
   22    11        INIT_FCALL                                               'var_export'
         12        INIT_FCALL                                               'foo'
         13        SEND_VAL                                                 3
         14        DO_FCALL                                      0  $4      
         15        SEND_VAR                                                 $4
         16        DO_ICALL                                                 
         17      > RETURN                                                   1

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/k9Etm
function name:  foo
number of ops:  6
compiled vars:  !0 = $x, !1 = $y
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
   16     1        BIND_STATIC                                              !1
   17     2        ASSIGN_DIM                                               !1
          3        OP_DATA                                                  !0
   18     4      > RETURN                                                   !1
   19     5*     > RETURN                                                   null

End of function foo

Class s:
Function s:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/k9Etm
function name:  s
number of ops:  6
compiled vars:  !0 = $x, !1 = $y
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    7     1        BIND_STATIC                                              !1
    8     2        ASSIGN_DIM                                               !1
          3        OP_DATA                                                  !0
    9     4      > RETURN                                                   !1
   10     5*     > RETURN                                                   null

End of function s

End of class s.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.35 ms | 1399 KiB | 17 Q