@sebastian@phpc.social
@sebastian@phpc.social avatar

sebastian

@sebastian@phpc.social

Created PHPUnit. Co-Founded thePHPcc. Helps developers build better software.

This profile is from a federated server and may be incomplete. Browse more on the original instance.

sebastian, to php
@sebastian@phpc.social avatar

A big "Thank you!" to @nielsdos for this #PHP performance fix and to @beberlei for writing about it:

https://tideways.com/profiler/blog/measuring-the-dom-namespace-reconciliation-performance-fix

derickr, (edited ) to photography
@derickr@phpc.social avatar

📷 Postojna Caves

🚩 Postojna, Slovenija

#StandingStoneSunday #Photography #Cave #Stalacmite #Stalactite

sebastian,
@sebastian@phpc.social avatar

@derickr I have fond memories of exploring those caves (and walking around the lake) with you.

sebastian, to opensource
@sebastian@phpc.social avatar

There goes my Sunday:

"Excluding merges, 1 author has pushed 36 commits to main and 36 commits to all branches. On main, 97 files have changed and there have been 99,239 additions and 56,143 deletions."

https://github.com/sebastianbergmann/foal

#OpenSource

sebastian, (edited )
@sebastian@phpc.social avatar

@klabauterjan The bytecode disassembly happens in separate PHP processes. These processes are started using the relevant INI settings:

https://github.com/sebastianbergmann/foal/blob/0.3.0/src/bytecode/VldLinesWithOpcodesFinder.php#L18-L20

sebastian, to opensource
@sebastian@phpc.social avatar

Adding the "No Maintenance Intended" badge to an #OpenSource project's README.md is so liberating.

sebastian, to random
@sebastian@phpc.social avatar

I dusted off my Find Optimized-Away Lines (FOAL) tool:

https://github.com/sebastianbergmann/foal

supergarv, to random German
@supergarv@phpc.social avatar

Bisher den einzigen #CodingStyle Dissenz im Team gibt's bei:

Leerzeichen vor oder nach (cast) statements (von PSR/PER nicht abgedeckt):

if ((bool) $var)
if ((bool)$var)

funcyCall((string)$something, (float)'1.337', (array)$var);

Werden wir wohl einen Fight Rule Club aufmachen.

sebastian, (edited )
@sebastian@phpc.social avatar

@supergarv Ich verweise an dieser Stelle auf einen Artikel von @spriebsch: https://thephp.cc/artikel/spaces-oder-tabs?ref=mastodon

sebastian, to php
@sebastian@phpc.social avatar

The #OpCache extension optimizes #PHP bytecode.

Extensions for collecting code coverage data such as #Xdebug operate on this bytecode.

Naturally, whether or not bytecode optimization is performed has an impact on the code coverage data that is collected.

I kn(e|o)w this. But such a difference just really surprised me for the first time.

Code Coverage reported with bytecode optimization enabled

sebastian,
@sebastian@phpc.social avatar

For #OpCache, PHP_BINARY can never be ''. Therefore, the code after the if statement's code is optimized away.

sebastian,
@sebastian@phpc.social avatar

The code after the body of the if statement predates the PHP_BINARY constant, which was introduced in PHP 5.4, IIRC.

The fact that #OpCache optimizes this code away suggests that I probably can get rid of it ...

sebastian,
@sebastian@phpc.social avatar

Maybe I should dust off the proof-of-concept I did for a tool that finds code that is optimized away by #OpCache years ago:

https://github.com/sebastianbergmann/foal

sebastian,
@sebastian@phpc.social avatar

@derickr IIRC, HHVM (at some point) set PHP_BINARY=''.

This code predates PHP 5.4, was changed to accommodate HHVM, and simplified for PHP >= 5.4 where PHP_BINARY exists.

I think I will just delete it.

sebastian,
@sebastian@phpc.social avatar

Unfortunately, #OpCache's bytecode dumping still does not show which line of code an opcode came from.

Unless I'm missing something, VLD is still needed for that.

https://gist.github.com/sebastianbergmann/bb9c8ab2285555f8d7a33022b4257c37

markusstaab, to opensource German
@markusstaab@phpc.social avatar

In Q1/2024 I #contributed to 26 #opensource projects a whopping 92 merged Pull Requests, mostly in my freetime.

Highlights

please consider sponsoring if you rely on this tools

https://github.com/sponsors/staabm

sebastian,
@sebastian@phpc.social avatar

@markusstaab Thank you!

sebastian, to php
@sebastian@phpc.social avatar

Over the last few months, I've been asked time and again:

"Sebastian, which PHP extension do you use to collect code coverage data?"

This question may sound simple, but to answer it I'm afraid I need to elaborate a little ...

https://thephp.cc/articles/pcov-or-xdebug?ref=mastodon

#php #xdebug #pcov #phpunit

sebastian,
@sebastian@phpc.social avatar

@derickr I plan to compare the results of PCOV and Xdebug in the future, but have not done so yet.

sebastian,
@sebastian@phpc.social avatar

@derickr AFAIK, PCOV does not perform dead code analysis.

supergarv, to random German
@supergarv@phpc.social avatar

Heute habe ich endlich mal mit phpcs und phpcs 🤡 herumgespielt und selber eingerichtet&konfiguriert.

So richtig klar ist mir immer noch nicht warum es dafür zwei Tools bedarf, und warum beide quasi gleich abgekürzt werden.

phpstan kriege ich ja noch abgegrenzt.

Und möchte/muss ich mich auch noch mit psalm einreiben?

sebastian,
@sebastian@phpc.social avatar

@supergarv @oliklee Diese Werkzeuge verfolgen unterschiedliche Ziele.

PHP-CS-Fixer kümmert sich, wie der Code aussieht: Formattierung, Reihenfolge der Methoden, keine unnötigen FQCNs, etc.

PHP_CodeSniffer kümmert sich vorrangig um Formattierung. Da es nicht darauf limitiert ist, alles, was es anmeckert, auch korrigieren zu können, kann es bspw. auch Softwaremetriken berechnen oder Aussagen über die benötigte PHP-Version treffen.

sebastian,
@sebastian@phpc.social avatar

@supergarv @oliklee Psalm und PHPStan machen statische Codeanalyse, um echte Fehler (keine Fehler in Bezug auf Aussehen des Codes) zu finden, ohne dass der Code, beispielsweise durch automatisierte Tests, tatsächlich ausgeführt wird.

sebastian, to berlin
@sebastian@phpc.social avatar

I am happy to announce that I will return to #SymfonyLive #Berlin this year.

Come to my talk "Testing with Doubles: Why, When, and How?" and learn the ins and outs of stubs and mocks. You will understand how #PHPUnit's test double functionality works and which parts of it you should stay clear of.

sebastian, to random
@sebastian@phpc.social avatar

I love it when a plan comes together and the relevant test passes.

markusstaab, to random German
@markusstaab@phpc.social avatar

TIL: when using shivammathur/setup-php@v2 you need to define ini-file: "development" to get php to emit deprecation warnings.

otherwise your unit tests won't catch deprecation warnings and the CI will unexpectedly succeed.

see https://github.com/shivammathur/setup-php/issues/827

sebastian,
@sebastian@phpc.social avatar
sebastian,
@sebastian@phpc.social avatar

@markusstaab I try to be as explicit as possible: no extensions by default, no INI settings by default. And then explicitly configure and load what I need.

sebastian, to random
@sebastian@phpc.social avatar

With GitHub Releases, is there a way to configure "N commits to 11.0 since this release" instead of "N commits to main since this release"?

sebastian,
@sebastian@phpc.social avatar

@alessandrolai Yes, the UI (which I don't use) has a dropdown. But that is for selecting the previous version, which is superfluous if you use semantic versioning.

sebastian,
@sebastian@phpc.social avatar

@ghostwriter I will look into this. Thanks!

  • All
  • Subscribed
  • Moderated
  • Favorites
  • provamag3
  • mdbf
  • ngwrru68w68
  • modclub
  • magazineikmin
  • thenastyranch
  • rosin
  • khanakhh
  • InstantRegret
  • Youngstown
  • slotface
  • Durango
  • kavyap
  • DreamBathrooms
  • JUstTest
  • GTA5RPClips
  • ethstaker
  • normalnudes
  • tester
  • osvaldo12
  • everett
  • cubers
  • tacticalgear
  • anitta
  • megavids
  • Leos
  • cisconetworking
  • lostlight
  • All magazines