Note that there are some explanatory texts on larger screens.

plurals
  1. POis my php interpreter going crazy, or am i the one who is...?
    primarykey
    data
    text
    <p>I'm continuing to run into really weird behaviour coding php. Here is an example:</p> <pre><code>&lt;?php date_default_timezone_set("Europe/Berlin"); $interval1 = (int) 336000; $interval2 = (int) 1459200; $interval3 = (int) 17403000; $interval4 = (int) 43205760; $interval5 = (int) 84299520; $week =  (int) 604800; ?&gt; </code></pre> <p>When I run this code, i get an "unexpected T_INT_CAST on line 8 error" WTF?!! the first 5 casts work perfectly fine. When i don't cast anything, the first 5 expressions result in a integer, the last one in a string. I noticed this while comparing values and obviously got wrong results.</p> <p>Here is the hex editor output (as requested in a comment):</p> <pre><code>00000000: 3C 3F 70 68 70 20 0A 64 61 74 65 5F 64 65 66 61 00000010: 75 6C 74 5F 74 69 6D 65 7A 6F 6E 65 5F 73 65 74 00000020: 28 22 45 75 72 6F 70 65 2F 42 65 72 6C 69 6E 22 00000030: 29 3B 0A 24 69 6E 74 65 72 76 61 6C 31 20 3D 20 00000040: 28 69 6E 74 29 20 33 33 36 30 30 30 3B 20 2F 2F 00000050: 74 65 73 74 20 69 6E 74 65 72 76 61 6C 20 66 72 00000060: 6F 6D 20 68 74 74 70 3A 2F 2F 65 63 6B 71 75 61 00000070: 72 74 65 72 73 2E 63 6F 6D 2F 6D 6F 65 74 65 72 00000080: 77 6F 6C 66 2F 64 69 61 67 72 61 6D 6D 31 2E 68 00000090: 74 6D 6C 0A 24 69 6E 74 65 72 76 61 6C 32 20 3D 000000A0: 20 28 69 6E 74 29 20 31 34 35 39 32 30 30 3B 0A 000000B0: 24 69 6E 74 65 72 76 61 6C 33 20 3D 20 28 69 6E 000000C0: 74 29 20 31 37 34 30 33 30 30 30 3B 0A 24 69 6E 000000D0: 74 65 72 76 61 6C 34 20 3D 20 28 69 6E 74 29 20 000000E0: 34 33 32 30 35 37 36 30 3B 0A 24 69 6E 74 65 72 000000F0: 76 61 6C 35 20 3D 20 28 69 6E 74 29 38 34 32 39 00000100: 39 35 32 30 3B 0A 24 77 65 65 6B 20 3D 20 A0 69 00000110: 6E 74 76 61 6C 28 36 30 34 38 30 30 29 3B </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload