Today during a session i had a strange "magic" feature found in php.

<?php
$a = 10;
echo ++$a + $a++;
?>

this works perfect as expected. it returns 22.
but if i assign $a as a ref. to another variable it will be return 23.

<?
$a = 10;
$b = &$a;
echo ++$a + $a++;
?>

this will gave me to 23
(used the $b to the pre post stuff)

<?
$a = 10;
$b = &$a;
echo ++$b + $b++;
?>

this just happens if i have a ref. count to my var. WHY? :)

http://en.wikipedia.org/wiki/23_%28film%29

--
Marco Kaiser

Reply via email to