3v4l.org

run code in 300+ PHP versions simultaneously
<?php $FEK_year = 2013; $url = 'http://www.et.gr/idocs-nph/search/fekForm.html'; $year = (int)$FEK_year; $resultsArray = array(array()); $index1 = 0; $index2 = 0; $FEK_year = 2013; $checkBoxIssue = NULL; $FEK_number = 1; $urlpdf = NULL; echo 'hello'; if ($year < 30) { $FEK_year = (string)(2000 + $year); } elseif ($year < 100) { $FEK_year = (string)(1900 + $year); } else { $FEK_year = (string)($year); } $fekyear = (int)$FEK_year; $data = array('year' => $FEK_year, $checkBoxIssue => 'on', 'fekNumberFrom' => $FEK_number, 'fekNumberTo' => $FEK_number, 'fekEffectiveDateFrom' => '01.01'.((string)$fekyear), 'fekEffectiveDateTo' => '31.12',((string)$fekyear), 'fekReleaseDateFrom' => '01.01'.((string)$fekyear), 'fekReleaseDateTo' => '31.12'.((string)($fekyear+1)), 'pageNumber' => '1'); // use key 'http' even if you send the request to https://... $options = array( 'http' => array( 'header' => "Accept-language: en\r\n" . "Content-type: application/x-www-form-urlencoded\r\n" . "User-agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.132 Safari/537.36\r\n", 'method' => 'POST', 'content' => http_build_query($data) ) ); $context = stream_context_create($options); $result = file_get_contents($url, false, $context); if (strpos($result, 'Το ΦΕΚ σε PDF μορφή') !== false) { $urlpdf = 'http://www.et.gr'.substr($results, strpos($results, 'href=') + 6, strpos($results, '\" target=') - (strpos($results, 'href=') + 6)); } return $urlpdf;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 18
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
2 jumps found. (Code = 43) Position 1 = 71, Position 2 = 93
Branch analysis from position: 71
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 93
Branch analysis from position: 18
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 24
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
Branch analysis from position: 24
2 jumps found. (Code = 43) Position 1 = 71, Position 2 = 93
Branch analysis from position: 71
Branch analysis from position: 93
filename:       /in/RR1b3
function name:  (null)
number of ops:  95
compiled vars:  !0 = $FEK_year, !1 = $url, !2 = $year, !3 = $resultsArray, !4 = $index1, !5 = $index2, !6 = $checkBoxIssue, !7 = $FEK_number, !8 = $urlpdf, !9 = $fekyear, !10 = $data, !11 = $options, !12 = $context, !13 = $result, !14 = $results
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 2013
    3     1        ASSIGN                                                   !1, 'http%3A%2F%2Fwww.et.gr%2Fidocs-nph%2Fsearch%2FfekForm.html'
    4     2        CAST                                          4  ~17     !0
          3        ASSIGN                                                   !2, ~17
    5     4        ASSIGN                                                   !3, <array>
    6     5        ASSIGN                                                   !4, 0
    7     6        ASSIGN                                                   !5, 0
    8     7        ASSIGN                                                   !0, 2013
    9     8        ASSIGN                                                   !6, null
   10     9        ASSIGN                                                   !7, 1
   11    10        ASSIGN                                                   !8, null
   12    11        ECHO                                                     'hello'
   14    12        IS_SMALLER                                               !2, 30
         13      > JMPZ                                                     ~26, ->18
   15    14    >   ADD                                              ~27     2000, !2
         15        CAST                                          6  ~28     ~27
         16        ASSIGN                                                   !0, ~28
   14    17      > JMP                                                      ->26
   16    18    >   IS_SMALLER                                               !2, 100
         19      > JMPZ                                                     ~30, ->24
   17    20    >   ADD                                              ~31     1900, !2
         21        CAST                                          6  ~32     ~31
         22        ASSIGN                                                   !0, ~32
   16    23      > JMP                                                      ->26
   19    24    >   CAST                                          6  ~34     !2
         25        ASSIGN                                                   !0, ~34
   22    26    >   CAST                                          4  ~36     !0
         27        ASSIGN                                                   !9, ~36
   23    28        INIT_ARRAY                                       ~38     !0, 'year'
   24    29        ADD_ARRAY_ELEMENT                                ~38     'on', !6
   25    30        ADD_ARRAY_ELEMENT                                ~38     !7, 'fekNumberFrom'
   26    31        ADD_ARRAY_ELEMENT                                ~38     !7, 'fekNumberTo'
   27    32        CAST                                          6  ~39     !9
         33        CONCAT                                           ~40     '01.01', ~39
         34        ADD_ARRAY_ELEMENT                                ~38     ~40, 'fekEffectiveDateFrom'
   28    35        ADD_ARRAY_ELEMENT                                ~38     '31.12', 'fekEffectiveDateTo'
         36        CAST                                          6  ~41     !9
         37        ADD_ARRAY_ELEMENT                                ~38     ~41
   29    38        CAST                                          6  ~42     !9
         39        CONCAT                                           ~43     '01.01', ~42
         40        ADD_ARRAY_ELEMENT                                ~38     ~43, 'fekReleaseDateFrom'
   30    41        ADD                                              ~44     !9, 1
         42        CAST                                          6  ~45     ~44
         43        CONCAT                                           ~46     '31.12', ~45
         44        ADD_ARRAY_ELEMENT                                ~38     ~46, 'fekReleaseDateTo'
   31    45        ADD_ARRAY_ELEMENT                                ~38     '1', 'pageNumber'
   23    46        ASSIGN                                                   !10, ~38
   38    47        INIT_ARRAY                                       ~48     'Accept-language%3A+en%0D%0AContent-type%3A+application%2Fx-www-form-urlencoded%0D%0AUser-agent%3A+Mozilla%2F5.0+%28Windows+NT+6.3%3B+WOW64%29+AppleWebKit%2F537.36+%28KHTML%2C+like+Gecko%29+Chrome%2F43.0.2357.132+Safari%2F537.36%0D%0A', 'header'
   39    48        ADD_ARRAY_ELEMENT                                ~48     'POST', 'method'
   40    49        INIT_FCALL                                               'http_build_query'
         50        SEND_VAR                                                 !10
         51        DO_ICALL                                         $49     
         52        ADD_ARRAY_ELEMENT                                ~48     $49, 'content'
         53        INIT_ARRAY                                       ~50     ~48, 'http'
   34    54        ASSIGN                                                   !11, ~50
   43    55        INIT_FCALL                                               'stream_context_create'
         56        SEND_VAR                                                 !11
         57        DO_ICALL                                         $52     
         58        ASSIGN                                                   !12, $52
   44    59        INIT_FCALL                                               'file_get_contents'
         60        SEND_VAR                                                 !1
         61        SEND_VAL                                                 <false>
         62        SEND_VAR                                                 !12
         63        DO_ICALL                                         $54     
         64        ASSIGN                                                   !13, $54
   45    65        INIT_FCALL                                               'strpos'
         66        SEND_VAR                                                 !13
         67        SEND_VAL                                                 '%CE%A4%CE%BF+%CE%A6%CE%95%CE%9A+%CF%83%CE%B5+PDF+%CE%BC%CE%BF%CF%81%CF%86%CE%AE'
         68        DO_ICALL                                         $56     
         69        TYPE_CHECK                                  1018          $56
         70      > JMPZ                                                     ~57, ->93
   46    71    >   INIT_FCALL                                               'substr'
         72        SEND_VAR                                                 !14
         73        INIT_FCALL                                               'strpos'
         74        SEND_VAR                                                 !14
         75        SEND_VAL                                                 'href%3D'
         76        DO_ICALL                                         $58     
         77        ADD                                              ~59     $58, 6
         78        SEND_VAL                                                 ~59
         79        INIT_FCALL                                               'strpos'
         80        SEND_VAR                                                 !14
         81        SEND_VAL                                                 '%5C%22+target%3D'
         82        DO_ICALL                                         $60     
         83        INIT_FCALL                                               'strpos'
         84        SEND_VAR                                                 !14
         85        SEND_VAL                                                 'href%3D'
         86        DO_ICALL                                         $61     
         87        ADD                                              ~62     $61, 6
         88        SUB                                              ~63     $60, ~62
         89        SEND_VAL                                                 ~63
         90        DO_ICALL                                         $64     
         91        CONCAT                                           ~65     'http%3A%2F%2Fwww.et.gr', $64
         92        ASSIGN                                                   !8, ~65
   48    93    > > RETURN                                                   !8
         94*     > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.85 ms | 1024 KiB | 18 Q