3v4l.org

run code in 300+ PHP versions simultaneously
<?php function IsOcta($string){ (int) $x=octdec("$string"); // Input must be a String and octdec returns NUMBER $y=decoct($x); // Must be a Number and decoct returns STRING echo "<br />IsOcta() - Octal Number Reconverted: ".$y; if($string==$y){ echo "<br /> Result: OCTAL"; }else{ echo "<br /> Result: NOT OCTAL"; } } $octal = 010; var_dump(IsOcta($octal));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/iCQH0
function name:  (null)
number of ops:  8
compiled vars:  !0 = $octal
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   ASSIGN                                                   !0, 8
   18     1        INIT_FCALL                                               'var_dump'
          2        INIT_FCALL                                               'isocta'
          3        SEND_VAR                                                 !0
          4        DO_FCALL                                      0  $2      
          5        SEND_VAR                                                 $2
          6        DO_ICALL                                                 
          7      > RETURN                                                   1

Function isocta:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 18
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/iCQH0
function name:  IsOcta
number of ops:  20
compiled vars:  !0 = $string, !1 = $x, !2 = $y
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'octdec'
          2        CAST                                          6  ~3      !0
          3        SEND_VAL                                                 ~3
          4        DO_ICALL                                         $4      
          5        ASSIGN                                           ~5      !1, $4
          6        CAST                                          4  ~6      ~5
          7        FREE                                                     ~6
    5     8        INIT_FCALL                                               'decoct'
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                         $7      
         11        ASSIGN                                                   !2, $7
    6    12        CONCAT                                           ~9      '%3Cbr+%2F%3EIsOcta%28%29+-+Octal+Number+Reconverted%3A+', !2
         13        ECHO                                                     ~9
    8    14        IS_EQUAL                                                 !0, !2
         15      > JMPZ                                                     ~10, ->18
    9    16    >   ECHO                                                     '%3Cbr+%2F%3E+Result%3A+OCTAL'
         17      > JMP                                                      ->19
   11    18    >   ECHO                                                     '%3Cbr+%2F%3E+Result%3A+NOT+OCTAL'
   14    19    > > RETURN                                                   null

End of function isocta

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.55 ms | 1390 KiB | 20 Q