3v4l.org

run code in 300+ PHP versions simultaneously
<?php $typeHandlers = [ 's', 'd','u', 'c', 'o', 'x', 'X', 'b', 'g', 'G', 'e', 'E', 'f', 'F', '+d', ]; $testNum = 22.12314123124; foreach($typeHandlers as $type){ printf("Type $type : %".$type."\n", $testNum); } $testArr = [ +1231241.12312312312, -1231241241.22231, 0.00000000000000000000001, 'stringy', ]; foreach($typeHandlers as $t){ printf("Type $t : %".$t." \n %".$t." \n %".$t." \n %".$t." \n", $testArr[0],$testArr[1], $testArr[2], $testArr[3]); }
based on 8Ku4O
Output for 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.24, 7.4.0 - 7.4.12, 8.0.0
Type s : 22.12314123124 Type d : 22 Type u : 22 Type c :  Type o : 26 Type x : 16 Type X : 16 Type b : 10110 Type g : 22.1231 Type G : 22.1231 Type e : 2.212314e+1 Type E : 2.212314E+1 Type f : 22.123141 Type F : 22.123141 Type +d : +22 Type s : 1231241.1231231 -1231241241.2223 1.0E-23 stringy Type d : 1231241 -1231241241 0 0 Type u : 1231241 18446744072478310375 0 0 Type c : � � Type o : 4544611 1777777777766647137747 0 0 Type x : 12c989 ffffffffb69cbfe7 0 0 Type X : 12C989 FFFFFFFFB69CBFE7 0 0 Type b : 100101100100110001001 1111111111111111111111111111111110110110100111001011111111100111 0 0 Type g : 1.23124e+6 -1.23124e+9 1.0e-23 0 Type G : 1.23124E+6 -1.23124E+9 1.0E-23 0 Type e : 1.231241e+6 -1.231241e+9 1.000000e-23 0.000000e+0 Type E : 1.231241E+6 -1.231241E+9 1.000000E-23 0.000000E+0 Type f : 1231241.123123 -1231241241.222310 0.000000 0.000000 Type F : 1231241.123123 -1231241241.222310 0.000000 0.000000 Type +d : +1231241 -1231241241 +0 +0