3v4l.org

run code in 300+ PHP versions simultaneously
<?php $purchaseCreateAt = '20170421'; $inflowDate = '-00011130'; echo strpos($inflowDate, '-') === 0 ? $purchaseCreateAt : $inflowDate; echo substr($inflowDate,0,1) === '-' ? $purchaseCreateAt : $inflowDate;
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 = 19, Position 2 = 21
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 21
Branch analysis from position: 19
Branch analysis from position: 21
filename:       /in/633ga
function name:  (null)
number of ops:  24
compiled vars:  !0 = $purchaseCreateAt, !1 = $inflowDate
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '20170421'
    3     1        ASSIGN                                                   !1, '-00011130'
    5     2        INIT_FCALL                                               'strpos'
          3        SEND_VAR                                                 !1
          4        SEND_VAL                                                 '-'
          5        DO_ICALL                                         $4      
          6        IS_IDENTICAL                                             $4, 0
          7      > JMPZ                                                     ~5, ->10
          8    >   QM_ASSIGN                                        ~6      !0
          9      > JMP                                                      ->11
         10    >   QM_ASSIGN                                        ~6      !1
         11    >   ECHO                                                     ~6
    7    12        INIT_FCALL                                               'substr'
         13        SEND_VAR                                                 !1
         14        SEND_VAL                                                 0
         15        SEND_VAL                                                 1
         16        DO_ICALL                                         $7      
         17        IS_IDENTICAL                                             $7, '-'
         18      > JMPZ                                                     ~8, ->21
         19    >   QM_ASSIGN                                        ~9      !0
         20      > JMP                                                      ->22
         21    >   QM_ASSIGN                                        ~9      !1
         22    >   ECHO                                                     ~9
         23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.55 ms | 1395 KiB | 17 Q