3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * Created by PhpStorm. * User: efik * Date: 20.09.16 * Time: 13:40 */ ///////////////////////// TEST ////////////////// $_POST = [ 'napoj' => 'herbata', 'name' => 'Krzysi', 'second_name' => 'dd' ]; $_SERVER["REQUEST_METHOD"] = 'POST'; /////////////////////// KONIEC DANYCH TESTOWYCH ///////// if($_SERVER["REQUEST_METHOD"] !== "POST") { exit; } if(!(['faktura', 'napoj', 'name', 'second_name'] === array_keys($_POST))){ echo "Wszystkie pola muszą być wypełnione! <br>"; exit; } $faktura = $_POST['faktura'] == 'on' ? 'Tak' : 'Nie'; $napoj = $_POST['napoj']; $name = $_POST['name']; $secondName = $_POST['second_name']; $orderDate = (new DateTime())->format("H:i, Y-m-d"); echo "Imie: {$name} <br>"; echo "Nazwisko: {$secondName} <br>"; echo "Faktura: {$faktura}<br>"; echo "Zamówienie: "; switch($napoj) { case 'herbata': echo "herabata"; break; case 'kawa': echo "herabata"; break; case 'pepsi': echo "herabata"; break; case 'woda mineralna': echo "woda mineralna"; break; } echo "<br>"; echo "Zamówienie złożone: {$orderDate} ";
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 10
Branch analysis from position: 9
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 19
Branch analysis from position: 17
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 19
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 25
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
6 jumps found. (Code = 188) Position 1 = 65, Position 2 = 67, Position 3 = 69, Position 4 = 71, Position 5 = 73, Position 6 = 56
Branch analysis from position: 65
1 jumps found. (Code = 42) Position 1 = 73
Branch analysis from position: 73
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 67
1 jumps found. (Code = 42) Position 1 = 73
Branch analysis from position: 73
Branch analysis from position: 69
1 jumps found. (Code = 42) Position 1 = 73
Branch analysis from position: 73
Branch analysis from position: 71
1 jumps found. (Code = 42) Position 1 = 73
Branch analysis from position: 73
Branch analysis from position: 73
Branch analysis from position: 56
2 jumps found. (Code = 44) Position 1 = 58, Position 2 = 65
Branch analysis from position: 58
2 jumps found. (Code = 44) Position 1 = 60, Position 2 = 67
Branch analysis from position: 60
2 jumps found. (Code = 44) Position 1 = 62, Position 2 = 69
Branch analysis from position: 62
2 jumps found. (Code = 44) Position 1 = 64, Position 2 = 71
Branch analysis from position: 64
1 jumps found. (Code = 42) Position 1 = 73
Branch analysis from position: 73
Branch analysis from position: 71
Branch analysis from position: 69
Branch analysis from position: 67
Branch analysis from position: 65
Branch analysis from position: 25
6 jumps found. (Code = 188) Position 1 = 65, Position 2 = 67, Position 3 = 69, Position 4 = 71, Position 5 = 73, Position 6 = 56
Branch analysis from position: 65
Branch analysis from position: 67
Branch analysis from position: 69
Branch analysis from position: 71
Branch analysis from position: 73
Branch analysis from position: 56
filename:       /in/X0r65
function name:  (null)
number of ops:  79
compiled vars:  !0 = $faktura, !1 = $napoj, !2 = $name, !3 = $secondName, !4 = $orderDate
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   FETCH_W                      global              $5      '_POST'
          1        ASSIGN                                                   $5, <array>
   17     2        FETCH_W                      global              $7      '_SERVER'
          3        ASSIGN_DIM                                               $7, 'REQUEST_METHOD'
          4        OP_DATA                                                  'POST'
   24     5        FETCH_R                      global              ~9      '_SERVER'
          6        FETCH_DIM_R                                      ~10     ~9, 'REQUEST_METHOD'
          7        IS_NOT_IDENTICAL                                         ~10, 'POST'
          8      > JMPZ                                                     ~11, ->10
   25     9    > > EXIT                                                     
   28    10    >   INIT_FCALL                                               'array_keys'
         11        FETCH_R                      global              ~12     '_POST'
         12        SEND_VAL                                                 ~12
         13        DO_ICALL                                         $13     
         14        IS_IDENTICAL                                     ~14     $13, <array>
         15        BOOL_NOT                                         ~15     ~14
         16      > JMPZ                                                     ~15, ->19
   29    17    >   ECHO                                                     'Wszystkie+pola+musz%C4%85+by%C4%87+wype%C5%82nione%21+%3Cbr%3E'
   30    18      > EXIT                                                     
   33    19    >   FETCH_R                      global              ~16     '_POST'
         20        FETCH_DIM_R                                      ~17     ~16, 'faktura'
         21        IS_EQUAL                                                 ~17, 'on'
         22      > JMPZ                                                     ~18, ->25
         23    >   QM_ASSIGN                                        ~19     'Tak'
         24      > JMP                                                      ->26
         25    >   QM_ASSIGN                                        ~19     'Nie'
         26    >   ASSIGN                                                   !0, ~19
   34    27        FETCH_R                      global              ~21     '_POST'
         28        FETCH_DIM_R                                      ~22     ~21, 'napoj'
         29        ASSIGN                                                   !1, ~22
   35    30        FETCH_R                      global              ~24     '_POST'
         31        FETCH_DIM_R                                      ~25     ~24, 'name'
         32        ASSIGN                                                   !2, ~25
   36    33        FETCH_R                      global              ~27     '_POST'
         34        FETCH_DIM_R                                      ~28     ~27, 'second_name'
         35        ASSIGN                                                   !3, ~28
   37    36        NEW                                              $30     'DateTime'
         37        DO_FCALL                                      0          
         38        INIT_METHOD_CALL                                         $30, 'format'
         39        SEND_VAL_EX                                              'H%3Ai%2C+Y-m-d'
         40        DO_FCALL                                      0  $32     
         41        ASSIGN                                                   !4, $32
   39    42        ROPE_INIT                                     3  ~35     'Imie%3A+'
         43        ROPE_ADD                                      1  ~35     ~35, !2
         44        ROPE_END                                      2  ~34     ~35, '+%3Cbr%3E'
         45        ECHO                                                     ~34
   40    46        ROPE_INIT                                     3  ~38     'Nazwisko%3A+'
         47        ROPE_ADD                                      1  ~38     ~38, !3
         48        ROPE_END                                      2  ~37     ~38, '+%3Cbr%3E'
         49        ECHO                                                     ~37
   41    50        ROPE_INIT                                     3  ~41     'Faktura%3A+'
         51        ROPE_ADD                                      1  ~41     ~41, !0
         52        ROPE_END                                      2  ~40     ~41, '%3Cbr%3E'
         53        ECHO                                                     ~40
   42    54        ECHO                                                     'Zam%C3%B3wienie%3A+'
   43    55      > SWITCH_STRING                                            !1, [ 'herbata':->65, 'kawa':->67, 'pepsi':->69, 'woda+mineralna':->71, ], ->73
   45    56    >   IS_EQUAL                                                 !1, 'herbata'
         57      > JMPNZ                                                    ~43, ->65
   46    58    >   IS_EQUAL                                                 !1, 'kawa'
         59      > JMPNZ                                                    ~43, ->67
   47    60    >   IS_EQUAL                                                 !1, 'pepsi'
         61      > JMPNZ                                                    ~43, ->69
   48    62    >   IS_EQUAL                                                 !1, 'woda+mineralna'
         63      > JMPNZ                                                    ~43, ->71
         64    > > JMP                                                      ->73
   45    65    >   ECHO                                                     'herabata'
         66      > JMP                                                      ->73
   46    67    >   ECHO                                                     'herabata'
         68      > JMP                                                      ->73
   47    69    >   ECHO                                                     'herabata'
         70      > JMP                                                      ->73
   48    71    >   ECHO                                                     'woda+mineralna'
         72      > JMP                                                      ->73
   50    73    >   ECHO                                                     '%3Cbr%3E'
   51    74        ROPE_INIT                                     3  ~45     'Zam%C3%B3wienie+z%C5%82o%C5%BCone%3A+'
         75        ROPE_ADD                                      1  ~45     ~45, !4
         76        ROPE_END                                      2  ~44     ~45, '+'
         77        ECHO                                                     ~44
         78      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
182.38 ms | 1445 KiB | 14 Q