3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = 'November 1997'; $str2 = 'November 20, 2001'; $matches; preg_match('/\d{4}/', $str,$matches); var_dump( (int) $str, intval($str), filter_var($str, FILTER_SANITIZE_NUMBER_INT), $matches );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cOcCY
function name:  (null)
number of ops:  20
compiled vars:  !0 = $str, !1 = $str2, !2 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'November+1997'
    3     1        ASSIGN                                                   !1, 'November+20%2C+2001'
    5     2        INIT_FCALL                                               'preg_match'
          3        SEND_VAL                                                 '%2F%5Cd%7B4%7D%2F'
          4        SEND_VAR                                                 !0
          5        SEND_REF                                                 !2
          6        DO_ICALL                                                 
    6     7        INIT_FCALL                                               'var_dump'
    7     8        CAST                                          4  ~6      !0
          9        SEND_VAL                                                 ~6
    8    10        CAST                                          4  ~7      !0
         11        SEND_VAL                                                 ~7
    9    12        INIT_FCALL                                               'filter_var'
         13        SEND_VAR                                                 !0
         14        SEND_VAL                                                 519
         15        DO_ICALL                                         $8      
         16        SEND_VAR                                                 $8
   10    17        SEND_VAR                                                 !2
         18        DO_ICALL                                                 
   11    19      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.55 ms | 1395 KiB | 19 Q