3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Manager { #[\NoDiscard] public function save(): int { return random_int(1, 8); } } $manager = new Manager(); // This should not be reported, see: // // https://www.php.net/manual/en/class.nodiscard.php (void) $manager->save(); // This is correctly reported if uncommented $manager->save(); echo $manager->save();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/trE2a
function name:  (null)
number of ops:  12
compiled vars:  !0 = $manager
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   10     0  E >   NEW                                                  $1      'Manager'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $1
   15     3        INIT_METHOD_CALL                                             !0, 'save'
          4        DO_FCALL                                          0  $4      
          5        FREE                                                         $4
   18     6        INIT_METHOD_CALL                                             !0, 'save'
          7        DO_FCALL                                          0          
   20     8        INIT_METHOD_CALL                                             !0, 'save'
          9        DO_FCALL                                          0  $6      
         10        ECHO                                                         $6
         11      > RETURN                                                       1

Class Manager:
Function save:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/trE2a
function name:  save
number of ops:  8
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    6     0  E >   INIT_FCALL                                                   'random_int'
          1        SEND_VAL                                                     1
          2        SEND_VAL                                                     8
          3        DO_ICALL                                             $0      
          4        VERIFY_RETURN_TYPE                                           $0
          5      > RETURN                                                       $0
    7     6*       VERIFY_RETURN_TYPE                                           
          7*     > RETURN                                                       null

End of function save

End of class Manager.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
154.22 ms | 1092 KiB | 14 Q