3v4l.org

run code in 300+ PHP versions simultaneously
<?php $c = new class { public function hello() { echo "hello"; } }; $c->hello(); $d = new class(42) { public function __construct($n) { echo $n; } public function hello() { echo "hello"; } }; $d->hello(); class SomeClass {} interface SomeInterface {} trait SomeTrait {} $e = new class(64) extends SomeClass implements SomeInterface { use SomeTrait; public function __construct($n) { echo $n; } public function hello() { echo "hello"; } }; $e->hello();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Mi5Xm
function name:  (null)
number of ops:  21
compiled vars:  !0 = $c, !1 = $d, !2 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_ANON_CLASS                               <unknown> 
          1        NEW                                              $4      $3
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $4
    7     4        INIT_METHOD_CALL                                         !0, 'hello'
          5        DO_FCALL                                      0          
    9     6        DECLARE_ANON_CLASS                               <unknown> 
          7        NEW                                              $9      $8
          8        SEND_VAL_EX                                              42
          9        DO_FCALL                                      0          
         10        ASSIGN                                                   !1, $9
   14    11        INIT_METHOD_CALL                                         !1, 'hello'
         12        DO_FCALL                                      0          
   20    13        DECLARE_ANON_CLASS                               'hello' 'someclass'
         14        NEW                                              $14     $13
         15        SEND_VAL_EX                                              64
         16        DO_FCALL                                      0          
         17        ASSIGN                                                   !2, $14
   26    18        INIT_METHOD_CALL                                         !2, 'hello'
         19        DO_FCALL                                      0          
         20      > RETURN                                                   1

Class class@anonymous:
Function hello:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Mi5Xm
function name:  hello
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ECHO                                                     'hello'
          1      > RETURN                                                   null

End of function hello

End of class class@anonymous.

Class class@anonymous:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Mi5Xm
function name:  __construct
number of ops:  3
compiled vars:  !0 = $n
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
          1        ECHO                                                     !0
          2      > RETURN                                                   null

End of function __construct

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

End of function hello

End of class class@anonymous.

Class SomeClass: [no user functions]
Class SomeInterface: [no user functions]
Class SomeTrait: [no user functions]
Class SomeClass@anonymous:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Mi5Xm
function name:  __construct
number of ops:  3
compiled vars:  !0 = $n
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   RECV                                             !0      
          1        ECHO                                                     !0
          2      > RETURN                                                   null

End of function __construct

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

End of function hello

End of class SomeClass@anonymous.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.07 ms | 1399 KiB | 13 Q