You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expressions in JSShop must be compatible with both JS and PHP.
Currently we have a problem with string concat.
PHP: $val = $str1 . $str2 for strings, $val = $int1 + $int2 for numeric values.
vs
JS val = str1 + str2 for strings AND numeric values.
The expression engine takes care of "transpiling" from JS syntax to PHP which is fairly easy for identifiers (str1 => $str1), but determining whether to use . (dot) or + (plus) is more difficult.
Expressions in JSShop must be compatible with both JS and PHP.
Currently we have a problem with string concat.
PHP:
$val = $str1 . $str2
for strings,$val = $int1 + $int2
for numeric values.vs
JS
val = str1 + str2
for strings AND numeric values.The expression engine takes care of "transpiling" from JS syntax to PHP which is fairly easy for identifiers (str1 => $str1), but determining whether to use . (dot) or + (plus) is more difficult.
Also, JS' ternary operator is right-associative (like all sane languages) while PHP's is left-associative: https://stackoverflow.com/questions/20559150/ternary-operator-left-associativity
While we can construct the short-hand conditional expression in a way that works with both JS and PHP, inconsistency is not acceptable.
We might have to disable support for generic expressions, and enforce use of functions to do even simple things - e.g.:
The text was updated successfully, but these errors were encountered: