3v4l.org

run code in 300+ PHP versions simultaneously
<?php const fuN = 1; new test; class test{ public function __construct() { fuN; $this->fun(); // prints test->fun $this->fuN(); //Call to undefined method test::fuN() fuN; // coment this out for : Uncaught Error: Undefined constant "fuN" } function fun(){ echo "<p>" . __CLASS__ . "->" . __FUNCTION__ . "</p>"; } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JuaDl
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CONST                                            'fuN', 1
    4     1        NEW                                              $0      'test'
          2        DO_FCALL                                      0          
          3        FREE                                                     $0
   15     4      > RETURN                                                   1

Class test:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JuaDl
function name:  __construct
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   FETCH_CONSTANT                                   ~0      'fuN'
          1        FREE                                                     ~0
    8     2        INIT_METHOD_CALL                                         'fun'
          3        DO_FCALL                                      0          
    9     4        INIT_METHOD_CALL                                         'fuN'
          5        DO_FCALL                                      0          
   10     6        FETCH_CONSTANT                                   ~3      'fuN'
          7        FREE                                                     ~3
   11     8      > RETURN                                                   null

End of function __construct

Function fun:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JuaDl
function name:  fun
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   ECHO                                                     '%3Cp%3Etest-%3Efun%3C%2Fp%3E'
   14     1      > RETURN                                                   null

End of function fun

End of class test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.81 ms | 1394 KiB | 13 Q