Discussion
Loading...

Post

Log in
  • About
  • Code of conduct
  • Privacy
  • Users
  • Instances
  • About Bonfire
Roberto B.
Roberto B.
@roberto@phpc.social  ·  activity timestamp 2 days ago

Last weekend, I was reading the State of JS 2025 survey and started wondering how those popular JavaScript syntax features translate to PHP.

I turned it into a small article comparing JS features with their PHP equivalents, with examples and explanations.

A curious weekend exercise ☕️

https://dev.to/robertobutti/state-of-js-2025-popular-syntax-features-explained-with-php-equivalents-4ffp

#JavaScript #PHP #WebDev #StateOfJS #DevCommunity #programming @thepracticaldev

DEV Community

State of JS 2025: Popular Syntax Features Explained with PHP Equivalents

The State of JS is an annual developer survey that captures how thousands of JavaScript developers...
  • Copy link
  • Flag this post
  • Block
Ben Ramsey
Ben Ramsey
@ramsey@phpc.social replied  ·  activity timestamp 2 days ago

@roberto @thepracticaldev You should mention PHP’s autoloading functionality under “dynamic import.”

  • Copy link
  • Flag this comment
  • Block
Ben Ramsey
Ben Ramsey
@ramsey@phpc.social replied  ·  activity timestamp 2 days ago

@roberto @thepracticaldev PHP also has the null coalescing assignment operator, like JavaScript: `??=`

  • Copy link
  • Flag this comment
  • Block
Roberto B.
Roberto B.
@roberto@phpc.social replied  ·  activity timestamp 2 days ago

@ramsey thank you ! I really appreciated your feedback. Added `??=`

  • Copy link
  • Flag this comment
  • Block
Ben Ramsey
Ben Ramsey
@ramsey@phpc.social replied  ·  activity timestamp 2 days ago

@roberto @thepracticaldev And there’s a proposal for a short ternary assignment operator (but it seems abandoned): https://wiki.php.net/rfc/short_ternary_equal_operator

PHP: rfc:short_ternary_equal_operator

  • Copy link
  • Flag this comment
  • Block

bonfire.cafe

A space for Bonfire maintainers and contributors to communicate

bonfire.cafe: About · Code of conduct · Privacy · Users · Instances
Bonfire social · 1.0.2-alpha.7 no JS en
Automatic federation enabled
Log in
  • Explore
  • About
  • Members
  • Code of Conduct