3v4l.org

run code in 500+ PHP versions simultaneously
<?php $contextA = ['browser_type' => 'chrome', 'browser_version' => null]; $contextB = ['browser_type' => 'chrome', 'browser_version' => '2.0']; $condition = function(array $context) { return !($context['browser_type'] == 'chrome' && $context['browser_version'] == '1.0'); }; echo 'Context A condition result: '.($condition($contextA) ? 'true' : 'false').PHP_EOL; echo 'Context B condition result: '.($condition($contextA) ? 'true' : 'false').PHP_EOL;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 10
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 20
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 20
Branch analysis from position: 18
Branch analysis from position: 20
filename:       /in/tsBnk
function name:  (null)
number of ops:  25
compiled vars:  !0 = $contextA, !1 = $contextB, !2 = $condition
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                       !0, <array>
    3     1        ASSIGN                                                       !1, <array>
    5     2        DECLARE_LAMBDA_FUNCTION                              ~5      [0]
          3        ASSIGN                                                       !2, ~5
    9     4        INIT_DYNAMIC_CALL                                            !2
          5        SEND_VAR_EX                                                  !0
          6        DO_FCALL                                          0  $7      
          7      > JMPZ                                                         $7, ->10
          8    >   QM_ASSIGN                                            ~8      'true'
          9      > JMP                                                          ->11
         10    >   QM_ASSIGN                                            ~8      'false'
         11    >   CONCAT                                               ~9      'Context+A+condition+result%3A+', ~8
         12        CONCAT                                               ~10     ~9, '%0A'
         13        ECHO                                                         ~10
   10    14        INIT_DYNAMIC_CALL                                            !2
         15        SEND_VAR_EX                                                  !0
         16        DO_FCALL                                          0  $11     
         17      > JMPZ                                                         $11, ->20
         18    >   QM_ASSIGN                                            ~12     'true'
         19      > JMP                                                          ->21
         20    >   QM_ASSIGN                                            ~12     'false'
         21    >   CONCAT                                               ~13     'Context+B+condition+result%3A+', ~12
         22        CONCAT                                               ~14     ~13, '%0A'
         23        ECHO                                                         ~14
   11    24      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 4, Position 2 = 7
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
filename:       /in/tsBnk
function name:  {closure:/in/tsBnk:5}
number of ops:  10
compiled vars:  !0 = $context
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   RECV                                                 !0      
    6     1        FETCH_DIM_R                                          ~1      !0, 'browser_type'
          2        IS_EQUAL                                             ~2      ~1, 'chrome'
          3      > JMPZ_EX                                              ~2      ~2, ->7
          4    >   FETCH_DIM_R                                          ~3      !0, 'browser_version'
          5        IS_EQUAL                                             ~4      ~3, '1.0'
          6        BOOL                                                 ~2      ~4
          7    >   BOOL_NOT                                             ~5      ~2
          8      > RETURN                                                       ~5
    7     9*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
152.25 ms | 1212 KiB | 12 Q