Y
Y
Yan Alexandrov2021-02-23 15:44:10
PHP
Yan Alexandrov, 2021-02-23 15:44:10

How to contribute to the development of PHP?

There is little desire to contribute to the development of PHP as a language. However, I am not familiar with the C language at all. The official site has the ability to add a proposal, but it is not at all clear how to issue it and whether anyone is considering them ... Or you need to offer not only a concept, but also a ready-made implementation. And in general, is it worth spending time on this?

The essence of the concept

Now, to display html elements in a loop, the following construction is used:
<?php if( $messages ) : ?>
<ul class="list">
  <?php foreach( $messages as $message ) : ?>
  <li class="list__item"><?php echo $message['content']; ?></li>
  <?php endforeach; ?>
</ul>
<?php endif; ?>

The idea is to make it more compact, for example:
<?php tag( 'ul class="list"', $messages as $message ) : ?>
  <li class="list__item"><?php echo $message['content']; ?></li>
<?php endtag( 'ul' ); ?>

The tag construct immediately checks for the existence and emptiness of the $messages array, as well as the output of the tag ul class="list".

And here's what it could look like with an else statement instead:
<ul class="list">
<?php if( $messages ) : ?>
  <?php foreach( $messages as $message ) : ?>
  <li class="list__item col-4"><?php echo $message['content']; ?></li>
  <?php endforeach; ?>
<?php else: ?>
  <li class="list__item col-12">Messages not found</li>
<?php endif; ?>
</ul>

could be like this:
<?php tag( 'ul class="list"', $messages as $message ) : ?>
  <li class="list__item col-4"><?php echo $message['content']; ?></li>
<?php elsetag(): ?>
  <li class="list__item col-12">Messages not found</li>
<?php endtag( 'ul' ); ?>


What do you think?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey Ukolov, 2021-02-23
@YanAlexandrov

All steps are described in detail: https://wiki.php.net/rfc/howto
However, I would not recommend you to waste your and others' time on this proposal.
First of all:

If you don't have the skills to fully implement your RFC and no-one volunteers to code it, there is little chance your RFC will be successful.

And secondly, this is such a niche and useless proposal that no one will complicate the language for the sake of it.

M
Mors Clamor, 2021-02-23
@66demon666

Make a framework that implements this concept, what is the problem, why C

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question