3v4l.org

run code in 300+ PHP versions simultaneously
<?php class NullObject { protected function __construct() { } static public function create() { return new self; } } //$null = new NullObject(); $null = NullObject::create(); var_dump(NULL);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7VlRY
function name:  (null)
number of ops:  7
compiled vars:  !0 = $null
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_STATIC_METHOD_CALL                                  'NullObject', 'create'
          1        DO_FCALL                                      0  $1      
          2        ASSIGN                                                   !0, $1
   14     3        INIT_FCALL                                               'var_dump'
          4        SEND_VAL                                                 null
          5        DO_ICALL                                                 
          6      > RETURN                                                   1

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

End of function __construct

Function create:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7VlRY
function name:  create
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   NEW                          self                $0      
          1        DO_FCALL                                      0          
          2      > RETURN                                                   $0
    9     3*     > RETURN                                                   null

End of function create

End of class NullObject.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.52 ms | 1395 KiB | 15 Q