3v4l.org

run code in 300+ PHP versions simultaneously
<?php $test = function (): bool { var_dump(__FUNCTION__ . ' is called'); return true; }; define('TEST', false); var_dump('Valuate TEST constant'); if(defined('TEST') && $test()) { var_dump('Test is called'); } echo PHP_EOL; echo PHP_EOL; var_dump('Valuate DOES_NOT_EXISTS constant'); if(defined('DOES_NOT_EXISTS') && $test()) { var_dump('Should not be called'); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 11, Position 2 = 14
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 18
Branch analysis from position: 15
2 jumps found. (Code = 46) Position 1 = 25, Position 2 = 28
Branch analysis from position: 25
2 jumps found. (Code = 43) Position 1 = 29, Position 2 = 32
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 32
Branch analysis from position: 28
Branch analysis from position: 18
Branch analysis from position: 14
filename:       /in/XlUp8
function name:  (null)
number of ops:  33
compiled vars:  !0 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FXlUp8%3A3%240'
          1        ASSIGN                                                   !0, ~1
    8     2        INIT_FCALL                                               'define'
          3        SEND_VAL                                                 'TEST'
          4        SEND_VAL                                                 <false>
          5        DO_ICALL                                                 
   10     6        INIT_FCALL                                               'var_dump'
          7        SEND_VAL                                                 'Valuate+TEST+constant'
          8        DO_ICALL                                                 
   12     9        DEFINED                                          ~5      'TEST'
         10      > JMPZ_EX                                          ~5      ~5, ->14
         11    >   INIT_DYNAMIC_CALL                                        !0
         12        DO_FCALL                                      0  $6      
         13        BOOL                                             ~5      $6
         14    > > JMPZ                                                     ~5, ->18
   13    15    >   INIT_FCALL                                               'var_dump'
         16        SEND_VAL                                                 'Test+is+called'
         17        DO_ICALL                                                 
   16    18    >   ECHO                                                     '%0A'
   17    19        ECHO                                                     '%0A'
   19    20        INIT_FCALL                                               'var_dump'
         21        SEND_VAL                                                 'Valuate+DOES_NOT_EXISTS+constant'
         22        DO_ICALL                                                 
   20    23        DEFINED                                          ~9      'DOES_NOT_EXISTS'
         24      > JMPZ_EX                                          ~9      ~9, ->28
         25    >   INIT_DYNAMIC_CALL                                        !0
         26        DO_FCALL                                      0  $10     
         27        BOOL                                             ~9      $10
         28    > > JMPZ                                                     ~9, ->32
   21    29    >   INIT_FCALL                                               'var_dump'
         30        SEND_VAL                                                 'Should+not+be+called'
         31        DO_ICALL                                                 
   22    32    > > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FXlUp8%3A3%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XlUp8
function name:  {closure}
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INIT_FCALL                                               'var_dump'
          1        SEND_VAL                                                 '%7Bclosure%7D+is+called'
          2        DO_ICALL                                                 
    5     3      > RETURN                                                   <true>
    6     4*       VERIFY_RETURN_TYPE                                       
          5*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FXlUp8%3A3%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.42 ms | 1405 KiB | 17 Q