3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Person { function getN(){return 5;} function ret(){return $this;} function retN(){return null;} } class NullPerson extends Person { function getN(){return 0;} function ret(){return $this;} function retN(){return null;} } $a = new Person(); $b = null; var_dump(($a??new NullPerson())->getN(), ($b??new NullPerson())->getN());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NpbIP
function name:  (null)
number of ops:  21
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   NEW                                              $2      'Person'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   18     3        ASSIGN                                                   !1, null
   19     4        INIT_FCALL                                               'var_dump'
          5        COALESCE                                         ~6      !0
          6        NEW                                              $7      'NullPerson'
          7        DO_FCALL                                      0          
          8        QM_ASSIGN                                        ~6      $7
          9        INIT_METHOD_CALL                                         ~6, 'getN'
         10        DO_FCALL                                      0  $9      
         11        SEND_VAR                                                 $9
   20    12        COALESCE                                         ~10     !1
         13        NEW                                              $11     'NullPerson'
         14        DO_FCALL                                      0          
         15        QM_ASSIGN                                        ~10     $11
         16        INIT_METHOD_CALL                                         ~10, 'getN'
         17        DO_FCALL                                      0  $13     
         18        SEND_VAR                                                 $13
         19        DO_ICALL                                                 
         20      > RETURN                                                   1

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

End of function getn

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

End of function ret

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

End of function retn

End of class Person.

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

End of function getn

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

End of function ret

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

End of function retn

End of class NullPerson.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
176.02 ms | 1400 KiB | 15 Q