3v4l.org

run code in 300+ PHP versions simultaneously
<?php $SERVER["SCRIPT_NAME"] = '/shops/deals.php'; define( 'PATH_TO_PAGE_ID_LOOKUP', [ "/index.php" => 1, "/shops/index.php" => 2, "/shops/dailydeals.php" => 4, "/shops/shops.php" => 5, "/shops/deals.php" => 9, "/shops/store.php" => 10, "/user/cashmail.php" => 13, ] ); define('DEFAULT_PAGE_ID', 1); $thisPageId = PATH_TO_PAGE_ID_LOOKUP[$SERVER["SCRIPT_NAME"]] ?? DEFAULT_PAGE_ID; echo $thisPageId;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rse8b
function name:  (null)
number of ops:  19
compiled vars:  !0 = $SERVER, !1 = $thisPageId
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN_DIM                                               !0, 'SCRIPT_NAME'
          1        OP_DATA                                                  '%2Fshops%2Fdeals.php'
    5     2        INIT_FCALL                                               'define'
    6     3        SEND_VAL                                                 'PATH_TO_PAGE_ID_LOOKUP'
    8     4        SEND_VAL                                                 <array>
    5     5        DO_ICALL                                                 
   17     6        INIT_FCALL                                               'define'
          7        SEND_VAL                                                 'DEFAULT_PAGE_ID'
          8        SEND_VAL                                                 1
          9        DO_ICALL                                                 
   19    10        FETCH_CONSTANT                                   ~5      'PATH_TO_PAGE_ID_LOOKUP'
         11        FETCH_DIM_R                                      ~6      !0, 'SCRIPT_NAME'
         12        FETCH_DIM_IS                                     ~7      ~5, ~6
         13        COALESCE                                         ~8      ~7
         14        FETCH_CONSTANT                                   ~9      'DEFAULT_PAGE_ID'
         15        QM_ASSIGN                                        ~8      ~9
         16        ASSIGN                                                   !1, ~8
   20    17        ECHO                                                     !1
   21    18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.29 ms | 997 KiB | 14 Q