3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo "\n\n【小数点のつく数値に対してintegerにキャストすると予期しない結果になる】\n\n"; echo (int) ( (0.1 + 0.7) * 10 ); echo "\n------------------------\n"; echo (float) ( (0.1 + 0.7) * 10 ); echo "\n\n【キャストは先頭が数字で始まる文字列のみ機能する】\n\n"; echo (int) "5txt"; echo "\n------------------------\n"; echo (int) "before5txt"; echo "\n------------------------\n"; echo (int) "53txt"; echo "\n------------------------\n"; echo (int) "53txt534text"; echo "\n------------------------\n"; echo "\n\n【数値リテラルの0は「8進数」という意味で認識されるが文字列の場合その限りではない】\n\n"; echo "\n[先頭0の数値]------------------------\n\n"; var_dump(0123); echo "\n[先頭0の文字列]------------------------\n\n"; var_dump("0123" + 0);
Output for git.master, git.master_jit, rfc.property-hooks
【小数点のつく数値に対してintegerにキャストすると予期しない結果になる】 7 ------------------------ 8 【キャストは先頭が数字で始まる文字列のみ機能する】 5 ------------------------ 0 ------------------------ 53 ------------------------ 53 ------------------------ 【数値リテラルの0は「8進数」という意味で認識されるが文字列の場合その限りではない】 [先頭0の数値]------------------------ int(83) [先頭0の文字列]------------------------ int(123)

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
63.52 ms | 402 KiB | 8 Q