3v4l.org

run code in 300+ PHP versions simultaneously
<?php //$var = 'A'; //$var = ''; //$var = null; $var = 0; $f1 = function($var) { if (! isset($var) || $var) { //echo "set default"; //"not empty or not defiend or a null value"; } else { //echo "not default"; //"empty"; } }; $f2 = function($var) { if (! isset($var) || $var) { //echo "set default"; } else { //echo "not default"; } }; $s1 = microtime(1); for ($i = 0; $i < 10000; $i++) { $f2($var); } echo microtime(1) - $s1; echo "\n"; $s = microtime(1); for ($i = 0; $i < 10000; $i++) { $f1($var); } echo microtime(1) - $s;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 11
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 33
Branch analysis from position: 33
2 jumps found. (Code = 44) Position 1 = 35, Position 2 = 29
Branch analysis from position: 35
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 29
2 jumps found. (Code = 44) Position 1 = 35, Position 2 = 29
Branch analysis from position: 35
Branch analysis from position: 29
Branch analysis from position: 11
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 11
Branch analysis from position: 17
Branch analysis from position: 11
filename:       /in/m7Vtd
function name:  (null)
number of ops:  41
compiled vars:  !0 = $var, !1 = $f1, !2 = $f2, !3 = $s1, !4 = $i, !5 = $s
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ASSIGN                                                   !0, 0
    6     1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fm7Vtd%3A6%240'
          2        ASSIGN                                                   !1, ~7
   14     3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fm7Vtd%3A14%241'
          4        ASSIGN                                                   !2, ~9
   23     5        INIT_FCALL                                               'microtime'
          6        SEND_VAL                                                 1
          7        DO_ICALL                                         $11     
          8        ASSIGN                                                   !3, $11
   25     9        ASSIGN                                                   !4, 0
         10      > JMP                                                      ->15
   26    11    >   INIT_DYNAMIC_CALL                                        !2
         12        SEND_VAR_EX                                              !0
         13        DO_FCALL                                      0          
   25    14        PRE_INC                                                  !4
         15    >   IS_SMALLER                                               !4, 10000
         16      > JMPNZ                                                    ~16, ->11
   29    17    >   INIT_FCALL                                               'microtime'
         18        SEND_VAL                                                 1
         19        DO_ICALL                                         $17     
         20        SUB                                              ~18     $17, !3
         21        ECHO                                                     ~18
   31    22        ECHO                                                     '%0A'
   33    23        INIT_FCALL                                               'microtime'
         24        SEND_VAL                                                 1
         25        DO_ICALL                                         $19     
         26        ASSIGN                                                   !5, $19
   35    27        ASSIGN                                                   !4, 0
         28      > JMP                                                      ->33
   36    29    >   INIT_DYNAMIC_CALL                                        !1
         30        SEND_VAR_EX                                              !0
         31        DO_FCALL                                      0          
   35    32        PRE_INC                                                  !4
         33    >   IS_SMALLER                                               !4, 10000
         34      > JMPNZ                                                    ~24, ->29
   39    35    >   INIT_FCALL                                               'microtime'
         36        SEND_VAL                                                 1
         37        DO_ICALL                                         $25     
         38        SUB                                              ~26     $25, !5
         39        ECHO                                                     ~26
         40      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2Fm7Vtd%3A6%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 4, Position 2 = 5
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 7
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
Branch analysis from position: 5
filename:       /in/m7Vtd
function name:  {closure}
number of ops:  8
compiled vars:  !0 = $var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    7     1        ISSET_ISEMPTY_CV                                 ~1      !0
          2        BOOL_NOT                                         ~2      ~1
          3      > JMPNZ_EX                                         ~2      ~2, ->5
          4    >   BOOL                                             ~2      !0
          5    > > JMPZ                                                     ~2, ->7
          6    > > JMP                                                      ->7
   12     7    > > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2Fm7Vtd%3A6%240

Function %00%7Bclosure%7D%2Fin%2Fm7Vtd%3A14%241:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 4, Position 2 = 5
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 7
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
Branch analysis from position: 5
filename:       /in/m7Vtd
function name:  {closure}
number of ops:  8
compiled vars:  !0 = $var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
   15     1        ISSET_ISEMPTY_CV                                 ~1      !0
          2        BOOL_NOT                                         ~2      ~1
          3      > JMPNZ_EX                                         ~2      ~2, ->5
          4    >   BOOL                                             ~2      !0
          5    > > JMPZ                                                     ~2, ->7
          6    > > JMP                                                      ->7
   20     7    > > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2Fm7Vtd%3A14%241

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.88 ms | 1400 KiB | 15 Q