3v4l.org

run code in 300+ PHP versions simultaneously
<?php // PHP_VERSION_ID is available as of PHP 5.2.7, if our // version is lower than that, then emulate it if (!defined('PHP_VERSION_ID')) { $version = explode('.', PHP_VERSION); define('PHP_VERSION_ID', ($version[0] * 10000 + $version[1] * 100 + $version[2])); } // PHP_VERSION_ID is defined as a number, where the higher the number // is, the newer a PHP version is used. It's defined as used in the above // expression: // // $version_id = $major_version * 10000 + $minor_version * 100 + $release_version; // // Now with PHP_VERSION_ID we can check for features this PHP version // may have, this doesn't require to use version_compare() everytime // you check if the current PHP version may not support a feature. // // For example, we may here define the PHP_VERSION_* constants thats // not available in versions prior to 5.2.7 if (PHP_VERSION_ID < 50207) { define('PHP_MAJOR_VERSION', $version[0]); define('PHP_MINOR_VERSION', $version[1]); define('PHP_RELEASE_VERSION', $version[2]); // and so on, ... } echo 'PHP_VERSION_ID: ' . PHP_VERSION_ID . ' '; echo 'PHP_MAJOR_VERSION: ' . PHP_MAJOR_VERSION . ' '; echo 'PHP_MINOR_VERSION: ' . PHP_MINOR_VERSION . ' '; echo 'PHP_RELEASE_VERSION: ' . PHP_RELEASE_VERSION . ' '; ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 1, Position 2 = 17
Branch analysis from position: 1
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 33
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 33
Branch analysis from position: 17
filename:       /in/0eKeL
function name:  (null)
number of ops:  38
compiled vars:  !0 = $version
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E > > JMPZ                                                     <false>, ->17
    5     1    >   INIT_FCALL                                               'explode'
          2        SEND_VAL                                                 '.'
          3        SEND_VAL                                                 '8.3.0'
          4        DO_ICALL                                         $1      
          5        ASSIGN                                                   !0, $1
    7     6        INIT_FCALL                                               'define'
          7        SEND_VAL                                                 'PHP_VERSION_ID'
          8        FETCH_DIM_R                                      ~3      !0, 0
          9        MUL                                              ~4      ~3, 10000
         10        FETCH_DIM_R                                      ~5      !0, 1
         11        MUL                                              ~6      ~5, 100
         12        ADD                                              ~7      ~4, ~6
         13        FETCH_DIM_R                                      ~8      !0, 2
         14        ADD                                              ~9      ~7, ~8
         15        SEND_VAL                                                 ~9
         16        DO_ICALL                                                 
   23    17    > > JMPZ                                                     <false>, ->33
   24    18    >   INIT_FCALL                                               'define'
         19        SEND_VAL                                                 'PHP_MAJOR_VERSION'
         20        FETCH_DIM_R                                      ~11     !0, 0
         21        SEND_VAL                                                 ~11
         22        DO_ICALL                                                 
   25    23        INIT_FCALL                                               'define'
         24        SEND_VAL                                                 'PHP_MINOR_VERSION'
         25        FETCH_DIM_R                                      ~13     !0, 1
         26        SEND_VAL                                                 ~13
         27        DO_ICALL                                                 
   26    28        INIT_FCALL                                               'define'
         29        SEND_VAL                                                 'PHP_RELEASE_VERSION'
         30        FETCH_DIM_R                                      ~15     !0, 2
         31        SEND_VAL                                                 ~15
         32        DO_ICALL                                                 
   32    33    >   ECHO                                                     'PHP_VERSION_ID%3A+80300++++'
   33    34        ECHO                                                     'PHP_MAJOR_VERSION%3A+8++'
   34    35        ECHO                                                     'PHP_MINOR_VERSION%3A+3++'
   35    36        ECHO                                                     'PHP_RELEASE_VERSION%3A+0++'
   36    37      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.37 ms | 1012 KiB | 15 Q