When I run the following code,
<?php
const nums = [1, 2, 3];
nums[0] = 50;
it gives me the following error:
Fatal error: Cannot use temporary expression in write context in <file> on line 4
My question is what exacty is a temporary expression in PHP? I've tried searching the documentation of PHP for an answer but there is nothing mentioned there regarding this error.
I just can't understand what exactly does this error mean?