3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Sample { private string $instantiatedViaConstructor; private ?string $notInstantiated; public function __construct(string $instantiatedViaConstructor) { $this->instantiatedViaConstructor = $instantiatedViaConstructor; } public function getNotInstantiated(): ?string { return $this->notInstantiated; } public function getWorkingNotInstantiated(): ?string { return $this->notInstantiated ?? null; } } var_dump((new Sample('foo'))->getWorkingNotInstantiated()); var_dump((new Sample('foo'))->getNotInstantiated());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GO48X
function name:  (null)
number of ops:  17
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   25     0  E >   INIT_FCALL                                                   'var_dump'
          1        NEW                                                  $0      'Sample'
          2        SEND_VAL_EX                                                  'foo'
          3        DO_FCALL                                          0          
          4        INIT_METHOD_CALL                                             $0, 'getWorkingNotInstantiated'
          5        DO_FCALL                                          0  $2      
          6        SEND_VAR                                                     $2
          7        DO_ICALL                                                     
   26     8        INIT_FCALL                                                   'var_dump'
          9        NEW                                                  $4      'Sample'
         10        SEND_VAL_EX                                                  'foo'
         11        DO_FCALL                                          0          
         12        INIT_METHOD_CALL                                             $4, 'getNotInstantiated'
         13        DO_FCALL                                          0  $6      
         14        SEND_VAR                                                     $6
         15        DO_ICALL                                                     
         16      > RETURN                                                       1

Class Sample:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GO48X
function name:  __construct
number of ops:  4
compiled vars:  !0 = $instantiatedViaConstructor
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    8     0  E >   RECV                                                 !0      
   10     1        ASSIGN_OBJ                                                   'instantiatedViaConstructor'
          2        OP_DATA                                                      !0
   11     3      > RETURN                                                       null

End of function __construct

Function getnotinstantiated:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GO48X
function name:  getNotInstantiated
number of ops:  5
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   15     0  E >   FETCH_OBJ_R                                          ~0      'notInstantiated'
          1        VERIFY_RETURN_TYPE                                           ~0
          2      > RETURN                                                       ~0
   16     3*       VERIFY_RETURN_TYPE                                           
          4*     > RETURN                                                       null

End of function getnotinstantiated

Function getworkingnotinstantiated:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GO48X
function name:  getWorkingNotInstantiated
number of ops:  7
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   20     0  E >   FETCH_OBJ_IS                                         ~0      'notInstantiated'
          1        COALESCE                                             ~1      ~0
          2        QM_ASSIGN                                            ~1      null
          3        VERIFY_RETURN_TYPE                                           ~1
          4      > RETURN                                                       ~1
   21     5*       VERIFY_RETURN_TYPE                                           
          6*     > RETURN                                                       null

End of function getworkingnotinstantiated

End of class Sample.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
227.22 ms | 2151 KiB | 13 Q