3v4l.org

run code in 500+ PHP versions simultaneously
<?php function getUserEmail(): ?string { return 'foo@example.com'; } function sendEMail(string $email) { echo "Email address is $email"; } sendEmail( getUserEmail() ?: throw new Exception("Email required") );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/YMLT1
function name:  (null)
number of ops:  12
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    6     0  E >   INIT_FCALL                                                   'sendemail'
          1        INIT_FCALL                                                   'getuseremail'
          2        DO_FCALL                                          0  $0      
          3        JMP_SET                                              ~1      $0, ->9
          4        NEW                                                  $2      'Exception'
          5        SEND_VAL_EX                                                  'Email+required'
          6        DO_FCALL                                          0          
          7      > THROW                                             1          $2
          8*       QM_ASSIGN                                            ~1      <true>
          9*       SEND_VAL                                                     ~1
         10*       DO_FCALL                                          0          
         11*     > RETURN                                                       1

Function getuseremail:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YMLT1
function name:  getUserEmail
number of ops:  3
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E > > RETURN                                                       'foo%40example.com'
          1*       VERIFY_RETURN_TYPE                                           
          2*     > RETURN                                                       null

End of function getuseremail

Function sendemail:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YMLT1
function name:  sendEMail
number of ops:  5
compiled vars:  !0 = $email
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    4     0  E >   RECV                                                 !0      
          1        NOP                                                          
          2        FAST_CONCAT                                          ~1      'Email+address+is+', !0
          3        ECHO                                                         ~1
          4      > RETURN                                                       null

End of function sendemail

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
169.06 ms | 1237 KiB | 15 Q