3v4l.org

run code in 300+ PHP versions simultaneously
<?php class CanNotSetProperties extends BadMethodCallException { } trait Immutable { public function __set($property, $value) { throw new CanNotSetProperties; } } final class Test { use Immutable; public function __construct() { echo 'hello'; } } $test = new Test; $test->__construct();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/iuvG8
function name:  (null)
number of ops:  7
compiled vars:  !0 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   DECLARE_CLASS                                            'test'
   22     1        NEW                                              $1      'Test'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   23     4        INIT_METHOD_CALL                                         !0, '__construct'
          5        DO_FCALL                                      0          
          6      > RETURN                                                   1

Class CanNotSetProperties: [no user functions]
Class Immutable:
Function __set:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/iuvG8
function name:  __set
number of ops:  6
compiled vars:  !0 = $property, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    9     2        NEW                                              $2      'CanNotSetProperties'
          3        DO_FCALL                                      0          
          4      > THROW                                         0          $2
   10     5*     > RETURN                                                   null

End of function __set

End of class Immutable.

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

End of function __construct

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.09 ms | 1394 KiB | 13 Q