3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Age { public function __construct(readonly public int $age) { if (0 > $age) { throw new DomainException('Age must be positive integer. "' . $age . '" provided.'); } } public function min(Age $comparingAge): Age { return min($this, $comparingAge); } } $firstAge = new Age(33); $secondAge = new Age(22); $minAge = $firstAge->min($secondAge); var_dump($minAge);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VvrQN
function name:  (null)
number of ops:  16
compiled vars:  !0 = $firstAge, !1 = $secondAge, !2 = $minAge
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   NEW                                              $3      'Age'
          1        SEND_VAL_EX                                              33
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $3
   16     4        NEW                                              $6      'Age'
          5        SEND_VAL_EX                                              22
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $6
   17     8        INIT_METHOD_CALL                                         !0, 'min'
          9        SEND_VAR_EX                                              !1
         10        DO_FCALL                                      0  $9      
         11        ASSIGN                                                   !2, $9
   18    12        INIT_FCALL                                               'var_dump'
         13        SEND_VAR                                                 !2
         14        DO_ICALL                                                 
         15      > RETURN                                                   1

Class Age:
Function __construct:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 11
Branch analysis from position: 5
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VvrQN
function name:  __construct
number of ops:  12
compiled vars:  !0 = $age
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        ASSIGN_OBJ                                               'age'
          2        OP_DATA                                                  !0
    5     3        IS_SMALLER                                               !0, 0
          4      > JMPZ                                                     ~1, ->11
    6     5    >   NEW                                              $2      'DomainException'
          6        CONCAT                                           ~3      'Age+must+be+positive+integer.+%22', !0
          7        CONCAT                                           ~4      ~3, '%22+provided.'
          8        SEND_VAL_EX                                              ~4
          9        DO_FCALL                                      0          
         10      > THROW                                         0          $2
    8    11    > > RETURN                                                   null

End of function __construct

Function min:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VvrQN
function name:  min
number of ops:  10
compiled vars:  !0 = $comparingAge
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
   11     1        INIT_FCALL                                               'min'
          2        FETCH_THIS                                       ~1      
          3        SEND_VAL                                                 ~1
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $2      
          6        VERIFY_RETURN_TYPE                                       $2
          7      > RETURN                                                   $2
   12     8*       VERIFY_RETURN_TYPE                                       
          9*     > RETURN                                                   null

End of function min

End of class Age.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.89 ms | 1004 KiB | 15 Q