3v4l.org

run code in 300+ PHP versions simultaneously
<?php $timePeriods = array( 'weekly' => 1, 'fortnightly' => 2, 'fourweekly' => 4, 'bianually' => 26, 'anually' => 52 ); $periods = array_keys($timePeriods); $recordName = 'ni_fortweekly_earning_limit'; $a = preg_match('(' . implode('|', $periods) . ')', $recordName); var_dump($a);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OMTAC
function name:  (null)
number of ops:  21
compiled vars:  !0 = $timePeriods, !1 = $periods, !2 = $recordName, !3 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    9     1        INIT_FCALL                                               'array_keys'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $5      
          4        ASSIGN                                                   !1, $5
   10     5        ASSIGN                                                   !2, 'ni_fortweekly_earning_limit'
   11     6        INIT_FCALL                                               'preg_match'
          7        INIT_FCALL                                               'implode'
          8        SEND_VAL                                                 '%7C'
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                         $8      
         11        CONCAT                                           ~9      '%28', $8
         12        CONCAT                                           ~10     ~9, '%29'
         13        SEND_VAL                                                 ~10
         14        SEND_VAR                                                 !2
         15        DO_ICALL                                         $11     
         16        ASSIGN                                                   !3, $11
   12    17        INIT_FCALL                                               'var_dump'
         18        SEND_VAR                                                 !3
         19        DO_ICALL                                                 
         20      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
288.14 ms | 1395 KiB | 21 Q