3v4l.org

run code in 500+ PHP versions simultaneously
<?php function withoutNativeTypesLoose($arg) { printf("%s: %s is %s\n", __FUNCTION__, var_export($arg, true), $arg ? 'truthy' : 'falsy'); } function withoutNativeTypesStrict($arg) { printf("%s: %s is %s\n", __FUNCTION__, var_export($arg, true), $arg === true ? 'truthy' : 'falsy'); } function withNativeTypes(bool $arg): void { printf("%s: %s is %s\n", __FUNCTION__, var_export($arg, true), $arg ? 'truthy' : 'falsy'); } withoutNativeTypesLoose(true); withoutNativeTypesLoose(false); withoutNativeTypesLoose(1); withoutNativeTypesLoose(0); withoutNativeTypesStrict(true); withoutNativeTypesStrict(false); withoutNativeTypesStrict(1); withoutNativeTypesStrict(0); withNativeTypes(true); withNativeTypes(false); withNativeTypes(1); withNativeTypes(0);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/buI6E
function name:  (null)
number of ops:  37
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   19     0  E >   INIT_FCALL                                                   'withoutnativetypesloose'
          1        SEND_VAL                                                     <true>
          2        DO_FCALL                                          0          
   20     3        INIT_FCALL                                                   'withoutnativetypesloose'
          4        SEND_VAL                                                     <false>
          5        DO_FCALL                                          0          
   21     6        INIT_FCALL                                                   'withoutnativetypesloose'
          7        SEND_VAL                                                     1
          8        DO_FCALL                                          0          
   22     9        INIT_FCALL                                                   'withoutnativetypesloose'
         10        SEND_VAL                                                     0
         11        DO_FCALL                                          0          
   24    12        INIT_FCALL                                                   'withoutnativetypesstrict'
         13        SEND_VAL                                                     <true>
         14        DO_FCALL                                          0          
   25    15        INIT_FCALL                                                   'withoutnativetypesstrict'
         16        SEND_VAL                                                     <false>
         17        DO_FCALL                                          0          
   26    18        INIT_FCALL                                                   'withoutnativetypesstrict'
         19        SEND_VAL                                                     1
         20        DO_FCALL                                          0          
   27    21        INIT_FCALL                                                   'withoutnativetypesstrict'
         22        SEND_VAL                                                     0
         23        DO_FCALL                                          0          
   29    24        INIT_FCALL                                                   'withnativetypes'
         25        SEND_VAL                                                     <true>
         26        DO_FCALL                                          0          
   30    27        INIT_FCALL                                                   'withnativetypes'
         28        SEND_VAL                                                     <false>
         29        DO_FCALL                                          0          
   31    30        INIT_FCALL                                                   'withnativetypes'
         31        SEND_VAL                                                     1
         32        DO_FCALL                                          0          
   32    33        INIT_FCALL                                                   'withnativetypes'
         34        SEND_VAL                                                     0
         35        DO_FCALL                                          0          
         36      > RETURN                                                       1

Function withoutnativetypesloose:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 12
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/buI6E
function name:  withoutNativeTypesLoose
number of ops:  16
compiled vars:  !0 = $arg
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   RECV                                                 !0      
    5     1        INIT_FCALL                                                   'printf'
          2        SEND_VAL                                                     '%25s%3A+%25s+is+%25s%0A'
          3        SEND_VAL                                                     'withoutNativeTypesLoose'
          4        INIT_FCALL                                                   'var_export'
          5        SEND_VAR                                                     !0
          6        SEND_VAL                                                     <true>
          7        DO_ICALL                                             $1      
          8        SEND_VAR                                                     $1
          9      > JMPZ                                                         !0, ->12
         10    >   QM_ASSIGN                                            ~2      'truthy'
         11      > JMP                                                          ->13
         12    >   QM_ASSIGN                                            ~2      'falsy'
         13    >   SEND_VAL                                                     ~2
         14        DO_ICALL                                                     
    6    15      > RETURN                                                       null

End of function withoutnativetypesloose

Function withoutnativetypesstrict:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 13
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/buI6E
function name:  withoutNativeTypesStrict
number of ops:  17
compiled vars:  !0 = $arg
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    8     0  E >   RECV                                                 !0      
   10     1        INIT_FCALL                                                   'printf'
          2        SEND_VAL                                                     '%25s%3A+%25s+is+%25s%0A'
          3        SEND_VAL                                                     'withoutNativeTypesStrict'
          4        INIT_FCALL                                                   'var_export'
          5        SEND_VAR                                                     !0
          6        SEND_VAL                                                     <true>
          7        DO_ICALL                                             $1      
          8        SEND_VAR                                                     $1
          9        TYPE_CHECK                                        8          !0
         10      > JMPZ                                                         ~2, ->13
         11    >   QM_ASSIGN                                            ~3      'truthy'
         12      > JMP                                                          ->14
         13    >   QM_ASSIGN                                            ~3      'falsy'
         14    >   SEND_VAL                                                     ~3
         15        DO_ICALL                                                     
   11    16      > RETURN                                                       null

End of function withoutnativetypesstrict

Function withnativetypes:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 12
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/buI6E
function name:  withNativeTypes
number of ops:  16
compiled vars:  !0 = $arg
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   14     0  E >   RECV                                                 !0      
   16     1        INIT_FCALL                                                   'printf'
          2        SEND_VAL                                                     '%25s%3A+%25s+is+%25s%0A'
          3        SEND_VAL                                                     'withNativeTypes'
          4        INIT_FCALL                                                   'var_export'
          5        SEND_VAR                                                     !0
          6        SEND_VAL                                                     <true>
          7        DO_ICALL                                             $1      
          8        SEND_VAR                                                     $1
          9      > JMPZ                                                         !0, ->12
         10    >   QM_ASSIGN                                            ~2      'truthy'
         11      > JMP                                                          ->13
         12    >   QM_ASSIGN                                            ~2      'falsy'
         13    >   SEND_VAL                                                     ~2
         14        DO_ICALL                                                     
   17    15      > RETURN                                                       null

End of function withnativetypes

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
165.2 ms | 1871 KiB | 27 Q